You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pnic_api.h 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Constants etc. for the Bochs/Etherboot pseudo-NIC
  3. *
  4. * This header file must be valid C and C++.
  5. *
  6. * Operation of the pseudo-NIC (PNIC) is pretty simple. To write a
  7. * command plus data, first write the length of the data to
  8. * PNIC_REG_LEN, then write the data a byte at a type to
  9. * PNIC_REG_DATA, then write the command code to PNIC_REG_CMD. The
  10. * status will be available from PNIC_REG_STAT. The length of any
  11. * data returned will be in PNIC_REG_LEN and can be read a byte at a
  12. * time from PNIC_REG_DATA.
  13. */
  14. FILE_LICENCE ( GPL2_OR_LATER );
  15. /*
  16. * PCI parameters
  17. */
  18. #define PNIC_PCI_VENDOR 0xfefe /* Hopefully these won't clash with */
  19. #define PNIC_PCI_DEVICE 0xefef /* any real PCI device IDs. */
  20. /*
  21. * 'Hardware' register addresses, offset from io_base
  22. */
  23. #define PNIC_REG_CMD 0x00 /* Command register, 2 bytes, write only */
  24. #define PNIC_REG_STAT 0x00 /* Status register, 2 bytes, read only */
  25. #define PNIC_REG_LEN 0x02 /* Length register, 2 bytes, read-write */
  26. #define PNIC_REG_DATA 0x04 /* Data port, 1 byte, read-write */
  27. /*
  28. * PNIC_MAX_REG used in Bochs to claim i/o space
  29. */
  30. #define PNIC_MAX_REG 0x04
  31. /*
  32. * Command code definitions: write these into PNIC_REG_CMD
  33. */
  34. #define PNIC_CMD_NOOP 0x0000
  35. #define PNIC_CMD_API_VER 0x0001
  36. #define PNIC_CMD_READ_MAC 0x0002
  37. #define PNIC_CMD_RESET 0x0003
  38. #define PNIC_CMD_XMIT 0x0004
  39. #define PNIC_CMD_RECV 0x0005
  40. #define PNIC_CMD_RECV_QLEN 0x0006
  41. #define PNIC_CMD_MASK_IRQ 0x0007
  42. #define PNIC_CMD_FORCE_IRQ 0x0008
  43. /*
  44. * Status code definitions: read these from PNIC_REG_STAT
  45. *
  46. * We avoid using status codes that might be confused with
  47. * randomly-read data (e.g. 0x0000, 0xffff etc.)
  48. */
  49. #define PNIC_STATUS_OK 0x4f4b /* 'OK' */
  50. #define PNIC_STATUS_UNKNOWN_CMD 0x3f3f /* '??' */
  51. /*
  52. * Other miscellaneous information
  53. */
  54. #define PNIC_API_VERSION 0x0101 /* 1.1 */