|
Lines 165-171
static long VNetFileOpUnlockedIoctl(struct file * filp,
Link Here
|
| 165 |
unsigned int iocmd, unsigned long ioarg); |
165 |
unsigned int iocmd, unsigned long ioarg); |
| 166 |
#endif |
166 |
#endif |
| 167 |
|
167 |
|
| 168 |
static struct file_operations vnetFileOps; |
168 |
static struct file_operations vnetFileOps = { |
|
|
169 |
.owner = THIS_MODULE, |
| 170 |
.read = VNetFileOpRead, |
| 171 |
.write = VNetFileOpWrite, |
| 172 |
.poll = VNetFileOpPoll, |
| 173 |
.unlocked_ioctl = VNetFileOpUnlockedIoctl, |
| 174 |
.compat_ioctl = VNetFileOpUnlockedIoctl, |
| 175 |
.open = VNetFileOpOpen, |
| 176 |
.release = VNetFileOpClose |
| 177 |
}; |
| 169 |
|
178 |
|
| 170 |
/* |
179 |
/* |
| 171 |
* Utility functions |
180 |
* Utility functions |
|
Lines 476-497
init_module(void)
Link Here
|
| 476 |
goto err_proto; |
491 |
goto err_proto; |
| 477 |
} |
492 |
} |
| 478 |
|
493 |
|
| 479 |
/* |
|
|
| 480 |
* Initialize the file_operations structure. Because this code is always |
| 481 |
* compiled as a module, this is fine to do it here and not in a static |
| 482 |
* initializer. |
| 483 |
*/ |
| 484 |
|
| 485 |
memset(&vnetFileOps, 0, sizeof vnetFileOps); |
| 486 |
vnetFileOps.owner = THIS_MODULE; |
| 487 |
vnetFileOps.read = VNetFileOpRead; |
| 488 |
vnetFileOps.write = VNetFileOpWrite; |
| 489 |
vnetFileOps.poll = VNetFileOpPoll; |
| 490 |
vnetFileOps.unlocked_ioctl = VNetFileOpUnlockedIoctl; |
| 491 |
vnetFileOps.compat_ioctl = VNetFileOpUnlockedIoctl; |
| 492 |
vnetFileOps.open = VNetFileOpOpen; |
| 493 |
vnetFileOps.release = VNetFileOpClose; |
| 494 |
|
| 495 |
retval = register_chrdev(VNET_MAJOR_NUMBER, "vmnet", &vnetFileOps); |
494 |
retval = register_chrdev(VNET_MAJOR_NUMBER, "vmnet", &vnetFileOps); |
| 496 |
if (retval) { |
495 |
if (retval) { |
| 497 |
LOG(0, (KERN_NOTICE "/dev/vmnet: could not register major device %d\n", |
496 |
LOG(0, (KERN_NOTICE "/dev/vmnet: could not register major device %d\n", |