Re: [PATCH] PnP Updates for 2.6.2-rc2

From: Adam Belay (ambx1_at_neo.rr.com)
Date: 01/30/04

  • Next message: Adam Belay: "Re: [PATCH] PnP Updates for 2.6.2-rc2"
    Date:	Fri, 30 Jan 2004 00:01:55 +0000
    To: Andrew Morton <akpm@osdl.org>
    
    

    This patch adds some aditional information to sysfs for pnp cards. It should be
    useful for userland tools.

    --- a/drivers/pnp/card.c 2004-01-29 23:08:49.000000000 +0000
    +++ b/drivers/pnp/card.c 2004-01-29 23:03:23.000000000 +0000
    @@ -139,6 +139,39 @@
             kfree(card);
     }
     
    +
    +static ssize_t pnp_show_card_name(struct device *dmdev, char *buf)
    +{
    + char *str = buf;
    + struct pnp_card *card = to_pnp_card(dmdev);
    + str += sprintf(str,"%s\n", card->name);
    + return (str - buf);
    +}
    +
    +static DEVICE_ATTR(name,S_IRUGO,pnp_show_card_name,NULL);
    +
    +static ssize_t pnp_show_card_ids(struct device *dmdev, char *buf)
    +{
    + char *str = buf;
    + struct pnp_card *card = to_pnp_card(dmdev);
    + struct pnp_id * pos = card->id;
    +
    + while (pos) {
    + str += sprintf(str,"%s\n", pos->id);
    + pos = pos->next;
    + }
    + return (str - buf);
    +}
    +
    +static DEVICE_ATTR(card_id,S_IRUGO,pnp_show_card_ids,NULL);
    +
    +static int pnp_interface_attach_card(struct pnp_card *card)
    +{
    + device_create_file(&card->dev,&dev_attr_name);
    + device_create_file(&card->dev,&dev_attr_card_id);
    + return 0;
    +}
    +
     /**
      * pnp_add_card - adds a PnP card to the PnP Layer
      * @card: pointer to the card to add
    @@ -158,6 +191,7 @@
             error = device_register(&card->dev);
     
             if (error == 0) {
    + pnp_interface_attach_card(card);
                     spin_lock(&pnp_lock);
                     list_add_tail(&card->global_list, &pnp_cards);
                     list_add_tail(&card->protocol_list, &card->protocol->cards);
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Adam Belay: "Re: [PATCH] PnP Updates for 2.6.2-rc2"

    Relevant Pages

    • Re: HARDWARE: Open-Source-Friendly Graphics Cards -- Viable?
      ... If it has any chance of being on-par or a little ... I wouldn't buy a card that wouldn't have the three aforementioned features. ... a blurry fast one. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.11 vs DVB cx88 stuffs
      ... >> be a good idea to build the cx88 stuff in the DVB section ... the card is working in ntsc just fine. ... Copyright 2005 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [RFC] Small PCI core patch
      ... the binary drivers make absolutely no verification of the ... > command streams passed from userland, you can make the card do whatever ... The resulting bad PR should fix their security holes quick ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: aditional parallel port problems
      ... > solve my problem with the help of Dino Klein, ... your card seems to be 'moded' through ... > module options the ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.9-rc1-bk11+ and 2.6.9-rc1-mm3,4 r8169: freeze during boot (FIX included)
      ... the crash is not immediate. ... possibly in>32-bit addresses but the card hasn't been told to support ... Turning off high DMA fixes it. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)