3c501.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Index to functions.
  3. */
  4. static int el1_probe1(struct net_device *dev, int ioaddr);
  5. static int el_open(struct net_device *dev);
  6. static void el_timeout(struct net_device *dev);
  7. static netdev_tx_t el_start_xmit(struct sk_buff *skb, struct net_device *dev);
  8. static irqreturn_t el_interrupt(int irq, void *dev_id);
  9. static void el_receive(struct net_device *dev);
  10. static void el_reset(struct net_device *dev);
  11. static int el1_close(struct net_device *dev);
  12. static void set_multicast_list(struct net_device *dev);
  13. static const struct ethtool_ops netdev_ethtool_ops;
  14. #define EL1_IO_EXTENT 16
  15. #ifndef EL_DEBUG
  16. #define EL_DEBUG 0 /* use 0 for production, 1 for devel., >2 for debug */
  17. #endif /* Anything above 5 is wordy death! */
  18. #define debug el_debug
  19. static int el_debug = EL_DEBUG;
  20. /*
  21. * Board-specific info in netdev_priv(dev).
  22. */
  23. struct net_local
  24. {
  25. int tx_pkt_start; /* The length of the current Tx packet. */
  26. int collisions; /* Tx collisions this packet */
  27. int loading; /* Spot buffer load collisions */
  28. int txing; /* True if card is in TX mode */
  29. spinlock_t lock; /* Serializing lock */
  30. };
  31. #define RX_STATUS (ioaddr + 0x06)
  32. #define RX_CMD RX_STATUS
  33. #define TX_STATUS (ioaddr + 0x07)
  34. #define TX_CMD TX_STATUS
  35. #define GP_LOW (ioaddr + 0x08)
  36. #define GP_HIGH (ioaddr + 0x09)
  37. #define RX_BUF_CLR (ioaddr + 0x0A)
  38. #define RX_LOW (ioaddr + 0x0A)
  39. #define RX_HIGH (ioaddr + 0x0B)
  40. #define SAPROM (ioaddr + 0x0C)
  41. #define AX_STATUS (ioaddr + 0x0E)
  42. #define AX_CMD AX_STATUS
  43. #define DATAPORT (ioaddr + 0x0F)
  44. #define TX_RDY 0x08 /* In TX_STATUS */
  45. #define EL1_DATAPTR 0x08
  46. #define EL1_RXPTR 0x0A
  47. #define EL1_SAPROM 0x0C
  48. #define EL1_DATAPORT 0x0f
  49. /*
  50. * Writes to the ax command register.
  51. */
  52. #define AX_OFF 0x00 /* Irq off, buffer access on */
  53. #define AX_SYS 0x40 /* Load the buffer */
  54. #define AX_XMIT 0x44 /* Transmit a packet */
  55. #define AX_RX 0x48 /* Receive a packet */
  56. #define AX_LOOP 0x0C /* Loopback mode */
  57. #define AX_RESET 0x80
  58. /*
  59. * Normal receive mode written to RX_STATUS. We must intr on short packets
  60. * to avoid bogus rx lockups.
  61. */
  62. #define RX_NORM 0xA8 /* 0x68 == all addrs, 0xA8 only to me. */
  63. #define RX_PROM 0x68 /* Senior Prom, uhmm promiscuous mode. */
  64. #define RX_MULT 0xE8 /* Accept multicast packets. */
  65. #define TX_NORM 0x0A /* Interrupt on everything that might hang the chip */
  66. /*
  67. * TX_STATUS register.
  68. */
  69. #define TX_COLLISION 0x02
  70. #define TX_16COLLISIONS 0x04
  71. #define TX_READY 0x08
  72. #define RX_RUNT 0x08
  73. #define RX_MISSED 0x01 /* Missed a packet due to 3c501 braindamage. */
  74. #define RX_GOOD 0x30 /* Good packet 0x20, or simple overflow 0x10. */