VMware Cloud Community
srivicky4esx
Contributor
Contributor

Difference Between vmklnx_register_blkdev and device_initialize

Hi all,

     We are porting sample Linux block disk driver into esxi 5.0 .In linux the device registered and itialized using the register_blkdev(sbull_major, "sbull") having only two arguments . But in esx we are using vmklnx_register_blkdev(major, name, bus, devfn, data) .So for non pci  block device means ,what should we give for the arguments for bus and devfn ..?

     If we should use device_initialize() instead of vmklnx_register_blkdev() means , for adding disk we need to use scsi_add_host (struct Scsi_Host * sh, struct device * pDev)  or add_disk() function is enough?

what is the value of arguments sh,pDev..?

Simply what is the flow of registering and intializing the queue using device_initialize()...?

Regards,

Vicky

0 Kudos
2 Replies
srivicky4esx
Contributor
Contributor

We got the solution ourself..Thanks for the Support..

device_initialize()- is just to intilaize the device..

In Esx as of now there is no seperate registration procedure for non pci devices. So we have to use vmklnx_register_blkdev() for all registration purposes.

Regards,

Vignesh

0 Kudos
sahilvarma12345
Contributor
Contributor

Hi Vignesh,

It would be great if you can let us know, how did you overcome the problem of providing

all the arguments to vmklnx_register_blkdev() i.e. bus , dev_fn etc...

I am also trying to port a non-pci driver, but stuck at the same point as yours..

It would be great of you could share your trick of registering one...

Regards

Sahil

0 Kudos