public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: <dongzai007@sohu.com>
To: <linux-kernel@vger.kernel.org>
Subject: vid&pid problems in usb_probe()
Date: Sat, 8 May 2004 11:48:44 +0800 (CST)	[thread overview]
Message-ID: <4830745.1083988124818.JavaMail.postfix@mx0.mail.sohu.com> (raw)



I am writting an usb driver.You know function usb_probe(...) is used to determine whether the usbdevices just pluged in is what the driver is for.

The Vid and Pid of my usb device are 0x1111 and 0x0000 respectively.

the program is :

static void* usb_probe(struct usb_device *udev, unsigned int ifnum, const struct usb_device_id *id)
{
    ..............
    ..............
    
    printk("<1>Vid:%x\nPid:%x\n",udev->descriptor.idVendor,udev->descriptor.idProduct);

    if ((udev->descriptor.idVendor!=0x1111)
         ||(udev->descriptor.idProduct!=0x0000)) return NULL;

    ..............
}

when I plug the device whose vid & pid is 0x1111 & 0x0000 respectively.
this Module displayed


Vid:0
Pid:201

usb.c ........ no active driver for this device;

and when I plug another device , I also got wrong vid & pid.

But when I wrote program as below:

__u16 tmp=0x1111;
printk("<1>%x",tmp);

it can print "1111" on the screen. That means my syntax is correct.
I mean, the problem may be at the data transfered into function usb_probe()
Maybe data transfered into function usb_probe() is wrong.

I wonder where is the problem, how can i solve.



             reply	other threads:[~2004-05-08  3:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-08  3:48 dongzai007 [this message]
2004-05-08  4:45 ` vid&pid problems in usb_probe() Randy.Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2004-05-08  9:05 dongzai007
2004-05-08 17:25 ` Randy.Dunlap
2004-05-09  2:03 dongzai007
2004-05-09  2:16 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4830745.1083988124818.JavaMail.postfix@mx0.mail.sohu.com \
    --to=dongzai007@sohu.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox