Thank you Hans,

In my system I was able to use this and the 

dev->bus->number 

(my system has 2 PCI buses clearly!) to fix cards to slots.  Now I know for sure that a card in slot 4 is video4.

Regards
Nick

On 11 Mar 2007, at 14:11, Hans Verkuil wrote:

On Sunday 11 March 2007 14:50, Nicholas Fearnley wrote:
Hi,

I have a fixed system in which I want to allocate /dev/video devices
based on which PCI slot my cards are placed in.  I have done this for
DVB devices already and now I want to do this for IVTV devices.

So basically if all I have is a device in say the third slot along on
my system (0000:05:03.0) then I will tie that device to /dev/video3.

Can anyone point me in the right direction?  I have found where I
think the registering of the device occurs but can't find where to
get which slot it belongs to , the ivtv struct only contains the
pci_dev which describes bus and I'm not sure there is slot info in
there.

I am using 0.8.0 (on 2.16.18.1).

Slot information can be obtained as follows (I think):

int pci_slot = PCI_SLOT(itv->dev->devfn);

This assumes you do not have a PVR-500: because that is basically two 
boards in one PCI slot and the slot returned by the line above is 
the 'slot' of the PVR unit on the card, not that of the actual PCI slot 
the card is in.

There is also a ivtv_first_minor module option that might be useful:

/* If you have already X v4l cards, then set this to X. This way
   the device numbers stay matched. Example: you have a WinTV card
   without radio and a PVR-350 with. Normally this would give a
   video1 device together with a radio0 device for the PVR. By
   setting this to 1 you ensure that radio0 is now also radio1. */
int ivtv_first_minor = 0;

Regards,

Hans

_______________________________________________
ivtv-devel mailing list


Nicholas Fearnley
Digital Media Projects Ltd
1 City Square
Leeds
LS1 2ES

t: 011 33 66 33 66
m: 07796 147 320

Disclaimer:

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.



_______________________________________________
ivtv-devel mailing list
ivtv-devel@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to