* Re: PCI hotplug question: drivers
@ 2006-09-15 6:27 sumalatha
2006-09-15 10:35 ` Greg KH
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: sumalatha @ 2006-09-15 6:27 UTC (permalink / raw)
To: linux-hotplug
Hello,
I am hotplugdriver_newbie in linux,but i wrote somany pci drivers for our
own cards. can you plz guide the begining steps to follow to start hotplug
drivers in linux.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PCI hotplug question: drivers
2006-09-15 6:27 PCI hotplug question: drivers sumalatha
@ 2006-09-15 10:35 ` Greg KH
2006-09-19 5:22 ` sumalatha
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2006-09-15 10:35 UTC (permalink / raw)
To: linux-hotplug
On Fri, Sep 15, 2006 at 06:27:38AM +0000, sumalatha wrote:
> Hello,
>
> I am hotplugdriver_newbie in linux,but i wrote somany pci drivers for our
> own cards. can you plz guide the begining steps to follow to start hotplug
> drivers in linux.
Hotplug what kind of driver?
The driver should not have to do anything special at all, just use the
normal calls to the subsystem you register with (PCI, USB, etc.) and
everything will work automatically.
thanks,
greg k-h
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PCI hotplug question: drivers
2006-09-15 6:27 PCI hotplug question: drivers sumalatha
2006-09-15 10:35 ` Greg KH
@ 2006-09-19 5:22 ` sumalatha
2006-09-19 14:05 ` Greg KH
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: sumalatha @ 2006-09-19 5:22 UTC (permalink / raw)
To: linux-hotplug
Hi Greg,
I am using PLX 9030 chip for all my pci cards.I used pci_find_device()
to detect my cards.And then pci_enable_device() to enable pci_dev structure.If
remapping is necessary I will do ioremap() and use those addresses to go the
local offsets. I will then interface this pci bus to my char device driver to
interact from the user space.Everything is working fine.All the hardware
features are met through my driver except hotswap.
Next what I did is, I enabled BUS OPTIONS(in kernel config) -pci
support for hotplug-cpci support for hotplug-generic driver for hotplug.I
rebuild the kernel .
I also have a doubt whether i should use any cpci_hotplug_core.c
functions in my driver.If I remove pci card from my cpci chassis should i take
care of slot_unconfigure() ? If so how to configure the slot again, because my
device is closed,and I can't interact with the driver thru my card . can I use
any of the /pci/hotplug/drivers to meet my requirements?
My final target is to develop a hotswap driver(for the above mentioned
cards) in linux and also in RTLinux. Will RTLinux support hotswap ?
thanks and regards,
sumalatha.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PCI hotplug question: drivers
2006-09-15 6:27 PCI hotplug question: drivers sumalatha
2006-09-15 10:35 ` Greg KH
2006-09-19 5:22 ` sumalatha
@ 2006-09-19 14:05 ` Greg KH
2006-09-20 12:32 ` sumalatha
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2006-09-19 14:05 UTC (permalink / raw)
To: linux-hotplug
On Tue, Sep 19, 2006 at 05:22:47AM +0000, sumalatha wrote:
> Hi Greg,
> I am using PLX 9030 chip for all my pci cards.I used pci_find_device()
> to detect my cards.And then pci_enable_device() to enable pci_dev structure.
Ick, no. Please read Documentation/pci.txt, a very old document that
tells you not to use this style for pci drivers. Please us
pci_register_driver() instead.
If you do that, your driver will work properly with any pci hotplug
driver.
hope this helps,
greg k-h
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PCI hotplug question: drivers
2006-09-15 6:27 PCI hotplug question: drivers sumalatha
` (2 preceding siblings ...)
2006-09-19 14:05 ` Greg KH
@ 2006-09-20 12:32 ` sumalatha
2006-09-20 15:39 ` Greg KH
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: sumalatha @ 2006-09-20 12:32 UTC (permalink / raw)
To: linux-hotplug
Greg KH <greg <at> kroah.com> writes:
>
> On Tue, Sep 19, 2006 at 05:22:47AM +0000, sumalatha wrote:
> > Hi Greg,
> >
>
> Ick, no. Please read Documentation/pci.txt, a very old document that
> tells you not to use this style for pci drivers. Please us
> pci_register_driver() instead.
>
> If you do that, your driver will work properly with any pci hotplug
> driver.
>
Exactly I did the same for linux driver,but when translating to RTLinux
driver I was confused with the probe() to access my 4 pci cards of 2 different
types which have same vendorid and deviceid.(2 cards of same type are having
same subdeviceid and subvendorid) and implemented 2.4 card detection functions.
According to your suggestion I implemented probe() and checked hotswap.
After hotswap ,device is detected (from user space fd value returned is 3) plx
is working fine ,i mean i am able to read hotswap status from 0x48 address (from
pci cinfig registers).it came correctly,but local bus offsets are not
working.when ever i read i am getting 0xffff always.i think problem from local
bus side.
what may be the mistake i did ? Also using my probe only one card driver is
registered.how to do for the other card.
here is my few lines of code.......
static struct pci_device_id dio_id_table[] __devinitdata = {
{0xAAAA,0xBBBB,0xCCCC,0xDDDD, 0, 0, 0 }, //SAME TYPE OF CARDS
{0xAAAA,0xBBBB,0xCCCC,0xDDDD, 0, 0, 0 },
{0,},
};
static int __devinit mycard_init_one(struct pci_dev *pdev,const struct
pci_device_id *ids)
{
static int i=0;
unsigned char pci_bus, pci_device_fn;
printk("\nprobe");
pci_enable_device(pdev);
pci_bus = pdev->bus->number;
pci_device_fn = pdev->devfn;
pio_start[i] = pci_resource_start(pdev, 2);
printf("\nBusnumber = %x",pci_bus);
printf("\nDevfn = %x",pci_device_fn);
printf("\nBAR2 ADDR = %x",pio_start[i]);
if(i = 0) {
if ( rtl_register_dev( "/dev/dev_0", &dio_fops, 0 ) ) {
printf("Unable to register /dev_0\n");
rtl_unregister_dev("/dev/dev_0");
//return -EIO;
}
}
if(i = 1) {
if ( rtl_register_dev( "/dev/dev_1", &dio_fops, 1 ) ) {
printf("Unable to register /dev_1\n");
rtl_unregister_dev("/dev/dev_1");
//return -EIO;
}
}
i++;
return 0;
}
static int __devexit mycard_remove_one(struct pci_dev *pdev)
{
pci_set_drvdata(pdev,NULL);
return 0;
}
module_init()
{
ret = pci_module_init(&dio_pci_rtl_driver);
printk("\nmain ret = %d ",ret);
if (ret != 0)
return (-1);
return 0;
}
cleanup_module()
{
rtl_unregister_dev("/dev/dev_0");
rtl_unregister_dev("/dev/dev_1");
pci_unregister_driver(&pci_rtl_driver);
return SUCCESS;
thanks and regards,
sumalatha.
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PCI hotplug question: drivers
2006-09-15 6:27 PCI hotplug question: drivers sumalatha
` (3 preceding siblings ...)
2006-09-20 12:32 ` sumalatha
@ 2006-09-20 15:39 ` Greg KH
2006-09-26 8:52 ` sumalatha
2006-09-28 6:08 ` Greg KH
6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2006-09-20 15:39 UTC (permalink / raw)
To: linux-hotplug
On Wed, Sep 20, 2006 at 12:32:36PM +0000, sumalatha wrote:
> Greg KH <greg <at> kroah.com> writes:
>
> >
> > On Tue, Sep 19, 2006 at 05:22:47AM +0000, sumalatha wrote:
> > > Hi Greg,
> > >
> >
> > Ick, no. Please read Documentation/pci.txt, a very old document that
> > tells you not to use this style for pci drivers. Please us
> > pci_register_driver() instead.
> >
> > If you do that, your driver will work properly with any pci hotplug
> > driver.
> >
> Exactly I did the same for linux driver,but when translating to RTLinux
> driver I was confused with the probe() to access my 4 pci cards of 2 different
> types which have same vendorid and deviceid.(2 cards of same type are having
> same subdeviceid and subvendorid) and implemented 2.4 card detection functions.
If you have rtlinux issues, I suggest you ask on a rtlinux specific
mailing list, as I do not know anything about it.
good luck,
greg k-h
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PCI hotplug question: drivers
2006-09-15 6:27 PCI hotplug question: drivers sumalatha
` (4 preceding siblings ...)
2006-09-20 15:39 ` Greg KH
@ 2006-09-26 8:52 ` sumalatha
2006-09-28 6:08 ` Greg KH
6 siblings, 0 replies; 8+ messages in thread
From: sumalatha @ 2006-09-26 8:52 UTC (permalink / raw)
To: linux-hotplug
Greg KH <greg <at> kroah.com> writes:
>
> If you have rtlinux issues, I suggest you ask on a rtlinux specific
> mailing list, as I do not know anything about it.
>
Hello Greg,
I am facing the same problem with linux driver too.Forget about
RTLinux.Regarding linux where may be the mistake in my code below. why local bus
offsets are giving 0xffff always after hot swap?
static struct pci_device_id my_id_table[] __devinitdata = {
{0xAAAA,0xBBBB,0xCCCC,0xDDDD, 0, 0, 0 },
{0xAAAA,0xBBBB,0xCCCC,0xDDDD, 0, 0, 0 },
{0,},
};
MODULE_DEVICE_TABLE(pci, my_id_table);
static int __devinit my_init_one (struct pci_dev *, const struct pci_device_id *);
static int __devexit my_remove_one (struct pci_dev *);
static struct pci_driver my_pci_driver = {
name: DRV_NAME,
id_table: my_id_table,
probe: my_init_one,
remove: __devexit_p(my_remove_one)
};
static int __devinit my_init_one(struct pci_dev *pdev,const struct
pci_device_id *my_id_table)
{
unsigned char pci_bus, pci_device_fn;
int flag = -1,result = 0,ret = 0;
printf("my_init_one invoked!\n");
/* initialize device structures */
for(pciCnt = 0; pciCnt < MAX_DEV; pciCnt++)
devCtrl[pciCnt]=0;
/* Initialize PCI controller*/
devCtrl[i] = pdev;
if(pci_enable_device(devCtrl[i]) < 0) {
printf("\nnot enabled");
ret = -EBUSY;
}
pci_bus = devCtrl[i]->bus->number;
pci_device_fn = devCtrl[i]->devfn;
pio_start[i] = pci_resource_start(devCtrl[i], 2);
len[i] = pci_resource_len(devCtrl[i], 2);
printf("\nBusnumber = %x",pci_bus);
printf("\nDevfn = %x",pci_device_fn);
printf("\nBAR2 ADDR = %x",pio_start[i]);
if((pci_request_regions(pdev,DRV_NAME))) {
ret = -ENOMEM;
// goto mem_err_out;
}
if(i = 0) {
if(register_chrdev(---, "mydev_0", &my_fops)) {
ret = -EIO;
// goto register_err_out;
}
}
if(i = 1 ) {
if ( register_chrdev(----, "mydev_1", &my_fops)) {
ret = -EIO;
// goto register_err_out;
}
}
i++;
return ret;
}
static int __devexit my_remove_one(struct pci_dev *pdev)
{
int j=0,k;
printf ("my_remove_one invoked!\n");
pci_release_regions(pdev);
pci_disable_device(pdev);
return 0;
}
init_module()
{
int ret;
printk("\nmy_init\n");
ret = pci_module_init(&my_pci_driver);
printk("\nmain ret = %d ",ret);
if (ret != 0)
return -EFAULT;
cleanup_module()
{
pci_unregister_driver(&my_pci_driver);
unregister_chrdev("mydev_0");
unregister_chrdev("mydev_1");
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: PCI hotplug question: drivers
2006-09-15 6:27 PCI hotplug question: drivers sumalatha
` (5 preceding siblings ...)
2006-09-26 8:52 ` sumalatha
@ 2006-09-28 6:08 ` Greg KH
6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2006-09-28 6:08 UTC (permalink / raw)
To: linux-hotplug
On Tue, Sep 26, 2006 at 08:52:14AM +0000, sumalatha wrote:
> Greg KH <greg <at> kroah.com> writes:
>
> >
>
> > If you have rtlinux issues, I suggest you ask on a rtlinux specific
> > mailing list, as I do not know anything about it.
> >
>
> Hello Greg,
> I am facing the same problem with linux driver too.Forget about
> RTLinux.Regarding linux where may be the mistake in my code below. why local bus
> offsets are giving 0xffff always after hot swap?
I do not know. Please send this information, and the pci hotplug
controller that you are using to the pci hotplug mailing list. The
developers there can help you out better than this list can.
thanks,
greg k-h
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-09-28 6:08 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15 6:27 PCI hotplug question: drivers sumalatha
2006-09-15 10:35 ` Greg KH
2006-09-19 5:22 ` sumalatha
2006-09-19 14:05 ` Greg KH
2006-09-20 12:32 ` sumalatha
2006-09-20 15:39 ` Greg KH
2006-09-26 8:52 ` sumalatha
2006-09-28 6:08 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).