Re: How are USB drivers assigned?

2010-06-30 Thread Nicholas Mills
When the ums driver is loaded (at boot time or through kldload) it registers
itself with the usb "bus" driver. When your mouse is plugged in the bus
driver calls the "probe" routine of every driver that has registered with
it. If the ums probe routine detects that the new device is in fact a mouse
it returns the value BUS_PROBE_GENERIC to the bus driver to indicate that it
supports the new device.

Once all the probe routines have been run the bus driver runs the "attach"
routine of the driver that returned the highest non-error value from its
probe routine. In the case of a mouse the attach routine of ums should be
called. The ums attach routine is responsible for configuring the device for
use by the system. A successful return from the attach routine means the
device is added to the system and ready to be used.

For more info see /sys/dev/usb/input/ums.c especially the functions
ums_probe and ums_attach and the DRIVER_MODULE macro.

Hope this helps,

Nick

On Mon, Jun 28, 2010 at 10:37 PM,  wrote:

> On Tue, 29 Jun 2010 17:56:39 +0200 Roland Smith  wrote:
> > On Mon, Jun 28, 2010 at 11:03:38PM -1000, Gary Dunn wrote:
> > > Is there a file that associates drivers with USB device information?
> > > More specifically, how does a USB mouse get assigned to the ums driver?
> > > This is for FreeBSD 8.0, if it matters.
> >
> > When queried on connection the mouse identifies itself by sending a
> descrip> tor
> > as a Human Interface Device class peripheral, and specifically a mouse.
> The
> > USB driver then knows to attach the ums device driver.
>
> Thanks for the reply Roland.
>
> What I am looking for is
>
> > The USB driver then knows to attach the ums device driver.
>
> how it "knows."
>
> Gary Dunn
> Open Slate Project
>
>
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Problem running fdisk via sysinstall

2010-06-24 Thread Nicholas Mills
Excellent, I'm glad everything worked out. It may have been a leftover
secondary GPT. From g_part_gpt.c:

/* No primary? Check that there's a secondary. */
buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize,
&error);

This would seem to suggest that the secondary GPT is stored in the last
block of the drive. Zeroing that block would probably have worked too.

On Thu, Jun 24, 2010 at 12:41 PM, Mark Costlow  wrote:

> Nick, that worked!  I zero'd the whole disk, then everything worked
> like normal.
>
> Thanks,
>
> Mark
>
> On Wed, Jun 23, 2010 at 07:15:13PM -0600, Mark Costlow wrote:
> > Since I don't have any other ideas yet, I'll give that a try.  I'll
> > let you know if it works tomorrow if it has finished by then :-)
> >
> > Mark
> >
> > On Wed, Jun 23, 2010 at 07:46:38PM -0400, Nicholas Mills wrote:
> > >Mark,
> > >I'm certainly no expert, but I think I can point you in the right
> > >direction. The system appears to be attempting to read from a GPT
> > >stored on the disk from when you used it on Linux. I'm not sure of
> the
> > >specifics, but I do know that some GPT info is stored near the end
> of
> > >the drive. The easy (but slow) solution would be to use dd to write
> > >zeros to the entire drive (da1).
> > >Hope this helps,
> > >Nick
> > >On Wed, Jun 23, 2010 at 7:28 PM, Mark Costlow <[1]che...@swcp.com>
> > >wrote:
> > >
> > >  I hope this question isn't too stupid.
> > >  I have a machine with a 3Ware RAID card, with 4 SATA drives
> > >  attached.
> > >  2 drives are 250GB in a RAID1 volume, and act as the boot disk
> with
> > >  a standard freebsd partiction map (/, /var, /usr, and swap on this
> > >  disk).
> > >  The other 2 drives are 1TB in a RAID1 volume, intended to be
> mounted
> > >  as a separate data partition.  At boot both volumes are
> recognized:
> > >  Jun 22 18:38:51 ebi7 kernel: da0 at twa0 bus 0 target 0 lun 0
> > >  Jun 22 18:38:51 ebi7 kernel: da0: 
> Fixed
> > >  Direct Access SCSI-5 device
> > >  Jun 22 18:38:51 ebi7 kernel: da0: 100.000MB/s transfers
> > >  Jun 22 18:38:51 ebi7 kernel: da0: 238408MB (488259584 512 byte
> > >  sectors: 255H 63S/T 30392C)
> > >  Jun 22 18:38:51 ebi7 kernel: da1 at twa0 bus 0 target 1 lun 0
> > >  Jun 22 18:38:51 ebi7 kernel: da1: 
> Fixed
> > >  Direct Access SCSI-5 device
> > >  Jun 22 18:38:51 ebi7 kernel: da1: 100.000MB/s transfers
> > >  Jun 22 18:38:51 ebi7 kernel: da1: 953664MB (1953103872 512 byte
> > >  sectors: 255H 63S/T 121575C)
> > >  da0 is fine, and the system boots off of it with no problem.
> > >  When I try to add da1 to the system, I get the following:
> > >  * Run systinstall, Configure, Fdisk, select da1
> > >  * Get the friendly warning about the large geometry, click "Yes"
> > >  * Hit "A" to use entire disk.  Hit "W" to save, click "Yes",
> > >  select "None" for boot record.
> > >  * Fdisk says: "Wrote FDISK partition information out
> successfully."
> > >  * Per handbook, get out of sysinstall and re-run it, then
> > >  try to Label.  In the label editor, it knows nothing about
> > >  da1 (the device can be selected when going into the label
> > >  editor, but I can't create any partitions).
> > >  At the time when Fdisk says "Wrote FDISK partition information
> out,
> > >  successfully." this gets logged to /var/log/messages:
> > >  Jun 23 17:11:18 ebi7 kernel: GEOM: da1: corrupt or invalid GPT
> > >  detected.
> > >  Jun 23 17:11:18 ebi7 kernel: GEOM: da1: GPT rejected -- may not be
> > >  recoverable.
> > >  I've tried several variations, including running the command-line
> > >  equivalents, but keep hitting this same error (fdisk thinks
> > >  everything
> > >  is good, but the GPT error is logged).  I've also noticed that
> > >  /dev/da1 exists, but there is no /dev/da1s1 or /dev/da1s1e ... I'm
> > >  not sure when those should get created.
> > >  And the final possibly-relevant tidbit: these drives used to be
> > >  part of a different RAID on a linux system.  They've been
> > >  re-initialized
> &g

Re: Problem running fdisk via sysinstall

2010-06-23 Thread Nicholas Mills
Mark,

I'm certainly no expert, but I think I can point you in the right direction.
The system appears to be attempting to read from a GPT stored on the disk
from when you used it on Linux. I'm not sure of the specifics, but I do know
that some GPT info is stored near the end of the drive. The easy (but slow)
solution would be to use dd to write zeros to the entire drive (da1).

Hope this helps,

Nick

On Wed, Jun 23, 2010 at 7:28 PM, Mark Costlow  wrote:

> I hope this question isn't too stupid.
>
> I have a machine with a 3Ware RAID card, with 4 SATA drives attached.
>
> 2 drives are 250GB in a RAID1 volume, and act as the boot disk with
> a standard freebsd partiction map (/, /var, /usr, and swap on this disk).
>
> The other 2 drives are 1TB in a RAID1 volume, intended to be mounted
> as a separate data partition.  At boot both volumes are recognized:
>
> Jun 22 18:38:51 ebi7 kernel: da0 at twa0 bus 0 target 0 lun 0
> Jun 22 18:38:51 ebi7 kernel: da0:  Fixed Direct
> Access SCSI-5 device
> Jun 22 18:38:51 ebi7 kernel: da0: 100.000MB/s transfers
> Jun 22 18:38:51 ebi7 kernel: da0: 238408MB (488259584 512 byte sectors:
> 255H 63S/T 30392C)
> Jun 22 18:38:51 ebi7 kernel: da1 at twa0 bus 0 target 1 lun 0
> Jun 22 18:38:51 ebi7 kernel: da1:  Fixed Direct
> Access SCSI-5 device
> Jun 22 18:38:51 ebi7 kernel: da1: 100.000MB/s transfers
> Jun 22 18:38:51 ebi7 kernel: da1: 953664MB (1953103872 512 byte sectors:
> 255H 63S/T 121575C)
>
> da0 is fine, and the system boots off of it with no problem.
>
> When I try to add da1 to the system, I get the following:
>
> * Run systinstall, Configure, Fdisk, select da1
> * Get the friendly warning about the large geometry, click "Yes"
> * Hit "A" to use entire disk.  Hit "W" to save, click "Yes",
> select "None" for boot record.
> * Fdisk says: "Wrote FDISK partition information out successfully."
> * Per handbook, get out of sysinstall and re-run it, then
> try to Label.  In the label editor, it knows nothing about
> da1 (the device can be selected when going into the label
> editor, but I can't create any partitions).
>
> At the time when Fdisk says "Wrote FDISK partition information out,
> successfully." this gets logged to /var/log/messages:
>
> Jun 23 17:11:18 ebi7 kernel: GEOM: da1: corrupt or invalid GPT detected.
> Jun 23 17:11:18 ebi7 kernel: GEOM: da1: GPT rejected -- may not be
> recoverable.
>
>
> I've tried several variations, including running the command-line
> equivalents, but keep hitting this same error (fdisk thinks everything
> is good, but the GPT error is logged).  I've also noticed that
> /dev/da1 exists, but there is no /dev/da1s1 or /dev/da1s1e ... I'm
> not sure when those should get created.
>
> And the final possibly-relevant tidbit: these drives used to be
> part of a different RAID on a linux system.  They've been re-initialized
> into the RAID card on this system, and I've zero'd the first 1k of
> the volume with dd, so I don't *think* that should be a factor.
> I've worked with about a dozen systems with the same hardware in
> the configuration outlined above and haven't seen this problem
> before.  But I'm usually using fresh new disks so maybe it matters.
>
> I've googled this issue and found several people reporting similar
> symptoms over the years, but haven't found any posted solutions
> aside from telling people to read geom(8).
>
> Any hints or clue-by-fours?
>
> Mark
> --
> Mark Costlow| Southwest Cyberport | Fax:   +1-505-232-7975
> che...@swcp.com | Web:   www.swcp.com | Voice: +1-505-232-7992
>
> abq-strange.com -- Interesting photos taken in Albuquerque, NM
>   Last post: Shoe Pole - 2009-07-07 20:18:22
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscr...@freebsd.org"
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Network card attaching to the wrong driver

2010-06-23 Thread Nicholas Mills
All,

I am running 8.0-RELEASE and having trouble with the ed driver that is
compiled by default into GENERIC. My machine is actually a VM running under
Parallels Server Bare Metal 4. I would like my card to be attached to the
Parallels driver in ports (pvmnet) instead of ed. Is there some boot option
I could use? Both device drivers are looking for the same PCI vendor/device
id in their probe routines, and both drivers return the same value from
their probe functions (so they have equal priority).

Thanks,

Nick Mills
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"