dgrs.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * ioctl's for the Digi Intl. RightSwitch
  3. *
  4. * These network driver ioctl's are a bit obtuse compared to the usual
  5. * ioctl's for a "normal" device driver. Hey, I didn't invent it.
  6. *
  7. * Typical use:
  8. *
  9. * struct ifreq ifr;
  10. * DGRS_IOCTL ioc;
  11. * int x;
  12. *
  13. * strcpy(ifr.ifr_name, "eth1");
  14. * ifr.ifr_data = (caddr_t) &ioc;
  15. * ioc.cmd = DGRS_GETMEM;
  16. * ioc.len = sizeof(x);
  17. * ioc.data = (caddr_t) &x;
  18. * rc = ioctl(fd, DGRSIOCTL, &ifr);
  19. * printf("rc=%d mem=%x\n", rc, x);
  20. *
  21. */
  22. #include <linux/sockios.h>
  23. #define DGRSIOCTL SIOCDEVPRIVATE
  24. typedef struct dgrs_ioctl {
  25. unsigned short cmd; /* Command to run */
  26. unsigned short len; /* Length of the data buffer */
  27. unsigned char __user *data; /* Pointer to the data buffer */
  28. unsigned short port; /* port number for command, if needed */
  29. unsigned short filter; /* filter number for command, if needed */
  30. } DGRS_IOCTL;
  31. /*
  32. * Commands for the driver
  33. */
  34. #define DGRS_GETMEM 0x01 /* Get the dual port memory address */
  35. #define DGRS_SETFILTER 0x02 /* Set a filter */