Loading drivers/net/ipg.c +25 −23 Original line number Original line Diff line number Diff line Loading @@ -54,20 +54,22 @@ MODULE_AUTHOR("IC Plus Corp. 2003"); MODULE_DESCRIPTION("IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver"); MODULE_DESCRIPTION("IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver"); MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL"); //variable record -- index by leading revision/length /* //Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN * Variable record -- index by leading revision/length * Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN */ static unsigned short DefaultPhyParam[] = { static unsigned short DefaultPhyParam[] = { // 11/12/03 IP1000A v1-3 rev=0x40 /* 11/12/03 IP1000A v1-3 rev=0x40 */ /*-------------------------------------------------------------------------- /*-------------------------------------------------------------------------- (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 0xfff2, (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 0xfff2, 27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 0x0003, 23, 0x92f6, 27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 0x0003, 23, 0x92f6, 31, 0x0000, 23, 0x003d, 30, 0x00de, 20, 0x20e7, 9, 0x0700, 31, 0x0000, 23, 0x003d, 30, 0x00de, 20, 0x20e7, 9, 0x0700, --------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/ // 12/17/03 IP1000A v1-4 rev=0x40 /* 12/17/03 IP1000A v1-4 rev=0x40 */ (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 0x0000, 0x0000, 30, 0x005e, 9, 0x0700, 30, 0x005e, 9, 0x0700, // 01/09/04 IP1000A v1-5 rev=0x41 /* 01/09/04 IP1000A v1-5 rev=0x41 */ (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 0x0000, 0x0000, 30, 0x005e, 9, 0x0700, 30, 0x005e, 9, 0x0700, Loading Loading @@ -1080,11 +1082,11 @@ static int ipg_nic_rxrestore(struct net_device *dev) #ifdef JUMBO_FRAME #ifdef JUMBO_FRAME /* use jumboindex and jumbosize to control jumbo frame status /* use jumboindex and jumbosize to control jumbo frame status initial status is jumboindex=-1 and jumbosize=0 * initial status is jumboindex=-1 and jumbosize=0 1. jumboindex = -1 and jumbosize=0 : previous jumbo frame has been done. * 1. jumboindex = -1 and jumbosize=0 : previous jumbo frame has been done. 2. jumboindex != -1 and jumbosize != 0 : jumbo frame is not over size and receiving * 2. jumboindex != -1 and jumbosize != 0 : jumbo frame is not over size and receiving 3. jumboindex = -1 and jumbosize != 0 : jumbo frame is over size, already dump * 3. jumboindex = -1 and jumbosize != 0 : jumbo frame is over size, already dump previous receiving and need to continue dumping the current one * previous receiving and need to continue dumping the current one */ */ enum { enum { NORMAL_PACKET, NORMAL_PACKET, Loading Loading @@ -1200,7 +1202,7 @@ static void ipg_nic_rx_with_start_and_end(struct net_device *dev, jumbo->skb = NULL; jumbo->skb = NULL; } } // 1: found error, 0 no error /* 1: found error, 0 no error */ if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) return; return; Loading @@ -1208,7 +1210,7 @@ static void ipg_nic_rx_with_start_and_end(struct net_device *dev, if (!skb) if (!skb) return; return; // accept this frame and send to upper layer /* accept this frame and send to upper layer */ framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN; framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN; if (framelen > IPG_RXFRAG_SIZE) if (framelen > IPG_RXFRAG_SIZE) framelen = IPG_RXFRAG_SIZE; framelen = IPG_RXFRAG_SIZE; Loading @@ -1229,11 +1231,11 @@ static void ipg_nic_rx_with_start(struct net_device *dev, struct pci_dev *pdev = sp->pdev; struct pci_dev *pdev = sp->pdev; struct sk_buff *skb; struct sk_buff *skb; // 1: found error, 0 no error /* 1: found error, 0 no error */ if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) return; return; // accept this frame and send to upper layer /* accept this frame and send to upper layer */ skb = sp->rx_buff[entry]; skb = sp->rx_buff[entry]; if (!skb) if (!skb) return; return; Loading @@ -1260,7 +1262,7 @@ static void ipg_nic_rx_with_end(struct net_device *dev, { { struct ipg_jumbo *jumbo = &sp->jumbo; struct ipg_jumbo *jumbo = &sp->jumbo; //1: found error, 0 no error /* 1: found error, 0 no error */ if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { struct sk_buff *skb = sp->rx_buff[entry]; struct sk_buff *skb = sp->rx_buff[entry]; Loading Loading @@ -1311,7 +1313,7 @@ static void ipg_nic_rx_no_start_no_end(struct net_device *dev, { { struct ipg_jumbo *jumbo = &sp->jumbo; struct ipg_jumbo *jumbo = &sp->jumbo; //1: found error, 0 no error /* 1: found error, 0 no error */ if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { struct sk_buff *skb = sp->rx_buff[entry]; struct sk_buff *skb = sp->rx_buff[entry]; Loading drivers/net/ipg.h +16 −16 Original line number Original line Diff line number Diff line Loading @@ -51,7 +51,7 @@ /* I/O register offsets. */ /* I/O register offsets. */ enum ipg_regs { enum ipg_regs { DMA_CTRL = 0x00, DMA_CTRL = 0x00, RX_DMA_STATUS = 0x08, // Unused + reserved RX_DMA_STATUS = 0x08, /* Unused + reserved */ TFD_LIST_PTR_0 = 0x10, TFD_LIST_PTR_0 = 0x10, TFD_LIST_PTR_1 = 0x14, TFD_LIST_PTR_1 = 0x14, TX_DMA_BURST_THRESH = 0x18, TX_DMA_BURST_THRESH = 0x18, Loading @@ -64,21 +64,21 @@ enum ipg_regs { RX_DMA_POLL_PERIOD = 0x26, RX_DMA_POLL_PERIOD = 0x26, DEBUG_CTRL = 0x2c, DEBUG_CTRL = 0x2c, ASIC_CTRL = 0x30, ASIC_CTRL = 0x30, FIFO_CTRL = 0x38, // Unused FIFO_CTRL = 0x38, /* Unused */ FLOW_OFF_THRESH = 0x3c, FLOW_OFF_THRESH = 0x3c, FLOW_ON_THRESH = 0x3e, FLOW_ON_THRESH = 0x3e, EEPROM_DATA = 0x48, EEPROM_DATA = 0x48, EEPROM_CTRL = 0x4a, EEPROM_CTRL = 0x4a, EXPROM_ADDR = 0x4c, // Unused EXPROM_ADDR = 0x4c, /* Unused */ EXPROM_DATA = 0x50, // Unused EXPROM_DATA = 0x50, /* Unused */ WAKE_EVENT = 0x51, // Unused WAKE_EVENT = 0x51, /* Unused */ COUNTDOWN = 0x54, // Unused COUNTDOWN = 0x54, /* Unused */ INT_STATUS_ACK = 0x5a, INT_STATUS_ACK = 0x5a, INT_ENABLE = 0x5c, INT_ENABLE = 0x5c, INT_STATUS = 0x5e, // Unused INT_STATUS = 0x5e, /* Unused */ TX_STATUS = 0x60, TX_STATUS = 0x60, MAC_CTRL = 0x6c, MAC_CTRL = 0x6c, VLAN_TAG = 0x70, // Unused VLAN_TAG = 0x70, /* Unused */ PHY_SET = 0x75, PHY_SET = 0x75, PHY_CTRL = 0x76, PHY_CTRL = 0x76, STATION_ADDRESS_0 = 0x78, STATION_ADDRESS_0 = 0x78, Loading @@ -90,11 +90,11 @@ enum ipg_regs { HASHTABLE_1 = 0x90, HASHTABLE_1 = 0x90, RMON_STATISTICS_MASK = 0x98, RMON_STATISTICS_MASK = 0x98, STATISTICS_MASK = 0x9c, STATISTICS_MASK = 0x9c, RX_JUMBO_FRAMES = 0xbc, // Unused RX_JUMBO_FRAMES = 0xbc, /* Unused */ TCP_CHECKSUM_ERRORS = 0xc0, // Unused TCP_CHECKSUM_ERRORS = 0xc0, /* Unused */ IP_CHECKSUM_ERRORS = 0xc2, // Unused IP_CHECKSUM_ERRORS = 0xc2, /* Unused */ UDP_CHECKSUM_ERRORS = 0xc4, // Unused UDP_CHECKSUM_ERRORS = 0xc4, /* Unused */ TX_JUMBO_FRAMES = 0xf4 // Unused TX_JUMBO_FRAMES = 0xf4 /* Unused */ }; }; /* Ethernet MIB statistic register offsets. */ /* Ethernet MIB statistic register offsets. */ Loading Loading @@ -590,7 +590,7 @@ enum ipg_regs { * Define larger if expecting jumbo frames. * Define larger if expecting jumbo frames. */ */ #ifdef JUMBO_FRAME #ifdef JUMBO_FRAME //IPG_TXFRAG_SIZE must <= 0x2b00, or TX will crash /* IPG_TXFRAG_SIZE must <= 0x2b00, or TX will crash */ #define IPG_TXFRAG_SIZE JUMBO_FRAME_SIZE #define IPG_TXFRAG_SIZE JUMBO_FRAME_SIZE #endif #endif Loading @@ -598,7 +598,7 @@ enum ipg_regs { * Define larger if expecting jumbo frames. * Define larger if expecting jumbo frames. */ */ #ifdef JUMBO_FRAME #ifdef JUMBO_FRAME //4088=4096-8 /* 4088 = 4096 - 8 */ #define IPG_RXFRAG_SIZE __IPG_RXFRAG_SIZE #define IPG_RXFRAG_SIZE __IPG_RXFRAG_SIZE #define IPG_RXSUPPORT_SIZE IPG_MAX_RXFRAME_SIZE #define IPG_RXSUPPORT_SIZE IPG_MAX_RXFRAME_SIZE #else #else Loading Loading @@ -628,7 +628,7 @@ enum ipg_regs { /* specify the jumbo frame maximum size /* specify the jumbo frame maximum size * per unit is 0x600 (the rx_buffer size that one RFD can carry) * per unit is 0x600 (the rx_buffer size that one RFD can carry) */ */ #define MAX_JUMBOSIZE 0x8 // max is 12K #define MAX_JUMBOSIZE 0x8 /* max is 12K */ /* Key register values loaded at driver start up. */ /* Key register values loaded at driver start up. */ Loading Loading
drivers/net/ipg.c +25 −23 Original line number Original line Diff line number Diff line Loading @@ -54,20 +54,22 @@ MODULE_AUTHOR("IC Plus Corp. 2003"); MODULE_DESCRIPTION("IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver"); MODULE_DESCRIPTION("IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver"); MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL"); //variable record -- index by leading revision/length /* //Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN * Variable record -- index by leading revision/length * Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN */ static unsigned short DefaultPhyParam[] = { static unsigned short DefaultPhyParam[] = { // 11/12/03 IP1000A v1-3 rev=0x40 /* 11/12/03 IP1000A v1-3 rev=0x40 */ /*-------------------------------------------------------------------------- /*-------------------------------------------------------------------------- (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 0xfff2, (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 0xfff2, 27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 0x0003, 23, 0x92f6, 27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 0x0003, 23, 0x92f6, 31, 0x0000, 23, 0x003d, 30, 0x00de, 20, 0x20e7, 9, 0x0700, 31, 0x0000, 23, 0x003d, 30, 0x00de, 20, 0x20e7, 9, 0x0700, --------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/ // 12/17/03 IP1000A v1-4 rev=0x40 /* 12/17/03 IP1000A v1-4 rev=0x40 */ (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 0x0000, 0x0000, 30, 0x005e, 9, 0x0700, 30, 0x005e, 9, 0x0700, // 01/09/04 IP1000A v1-5 rev=0x41 /* 01/09/04 IP1000A v1-5 rev=0x41 */ (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 0x0000, 0x0000, 30, 0x005e, 9, 0x0700, 30, 0x005e, 9, 0x0700, Loading Loading @@ -1080,11 +1082,11 @@ static int ipg_nic_rxrestore(struct net_device *dev) #ifdef JUMBO_FRAME #ifdef JUMBO_FRAME /* use jumboindex and jumbosize to control jumbo frame status /* use jumboindex and jumbosize to control jumbo frame status initial status is jumboindex=-1 and jumbosize=0 * initial status is jumboindex=-1 and jumbosize=0 1. jumboindex = -1 and jumbosize=0 : previous jumbo frame has been done. * 1. jumboindex = -1 and jumbosize=0 : previous jumbo frame has been done. 2. jumboindex != -1 and jumbosize != 0 : jumbo frame is not over size and receiving * 2. jumboindex != -1 and jumbosize != 0 : jumbo frame is not over size and receiving 3. jumboindex = -1 and jumbosize != 0 : jumbo frame is over size, already dump * 3. jumboindex = -1 and jumbosize != 0 : jumbo frame is over size, already dump previous receiving and need to continue dumping the current one * previous receiving and need to continue dumping the current one */ */ enum { enum { NORMAL_PACKET, NORMAL_PACKET, Loading Loading @@ -1200,7 +1202,7 @@ static void ipg_nic_rx_with_start_and_end(struct net_device *dev, jumbo->skb = NULL; jumbo->skb = NULL; } } // 1: found error, 0 no error /* 1: found error, 0 no error */ if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) return; return; Loading @@ -1208,7 +1210,7 @@ static void ipg_nic_rx_with_start_and_end(struct net_device *dev, if (!skb) if (!skb) return; return; // accept this frame and send to upper layer /* accept this frame and send to upper layer */ framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN; framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN; if (framelen > IPG_RXFRAG_SIZE) if (framelen > IPG_RXFRAG_SIZE) framelen = IPG_RXFRAG_SIZE; framelen = IPG_RXFRAG_SIZE; Loading @@ -1229,11 +1231,11 @@ static void ipg_nic_rx_with_start(struct net_device *dev, struct pci_dev *pdev = sp->pdev; struct pci_dev *pdev = sp->pdev; struct sk_buff *skb; struct sk_buff *skb; // 1: found error, 0 no error /* 1: found error, 0 no error */ if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) return; return; // accept this frame and send to upper layer /* accept this frame and send to upper layer */ skb = sp->rx_buff[entry]; skb = sp->rx_buff[entry]; if (!skb) if (!skb) return; return; Loading @@ -1260,7 +1262,7 @@ static void ipg_nic_rx_with_end(struct net_device *dev, { { struct ipg_jumbo *jumbo = &sp->jumbo; struct ipg_jumbo *jumbo = &sp->jumbo; //1: found error, 0 no error /* 1: found error, 0 no error */ if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { struct sk_buff *skb = sp->rx_buff[entry]; struct sk_buff *skb = sp->rx_buff[entry]; Loading Loading @@ -1311,7 +1313,7 @@ static void ipg_nic_rx_no_start_no_end(struct net_device *dev, { { struct ipg_jumbo *jumbo = &sp->jumbo; struct ipg_jumbo *jumbo = &sp->jumbo; //1: found error, 0 no error /* 1: found error, 0 no error */ if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { struct sk_buff *skb = sp->rx_buff[entry]; struct sk_buff *skb = sp->rx_buff[entry]; Loading
drivers/net/ipg.h +16 −16 Original line number Original line Diff line number Diff line Loading @@ -51,7 +51,7 @@ /* I/O register offsets. */ /* I/O register offsets. */ enum ipg_regs { enum ipg_regs { DMA_CTRL = 0x00, DMA_CTRL = 0x00, RX_DMA_STATUS = 0x08, // Unused + reserved RX_DMA_STATUS = 0x08, /* Unused + reserved */ TFD_LIST_PTR_0 = 0x10, TFD_LIST_PTR_0 = 0x10, TFD_LIST_PTR_1 = 0x14, TFD_LIST_PTR_1 = 0x14, TX_DMA_BURST_THRESH = 0x18, TX_DMA_BURST_THRESH = 0x18, Loading @@ -64,21 +64,21 @@ enum ipg_regs { RX_DMA_POLL_PERIOD = 0x26, RX_DMA_POLL_PERIOD = 0x26, DEBUG_CTRL = 0x2c, DEBUG_CTRL = 0x2c, ASIC_CTRL = 0x30, ASIC_CTRL = 0x30, FIFO_CTRL = 0x38, // Unused FIFO_CTRL = 0x38, /* Unused */ FLOW_OFF_THRESH = 0x3c, FLOW_OFF_THRESH = 0x3c, FLOW_ON_THRESH = 0x3e, FLOW_ON_THRESH = 0x3e, EEPROM_DATA = 0x48, EEPROM_DATA = 0x48, EEPROM_CTRL = 0x4a, EEPROM_CTRL = 0x4a, EXPROM_ADDR = 0x4c, // Unused EXPROM_ADDR = 0x4c, /* Unused */ EXPROM_DATA = 0x50, // Unused EXPROM_DATA = 0x50, /* Unused */ WAKE_EVENT = 0x51, // Unused WAKE_EVENT = 0x51, /* Unused */ COUNTDOWN = 0x54, // Unused COUNTDOWN = 0x54, /* Unused */ INT_STATUS_ACK = 0x5a, INT_STATUS_ACK = 0x5a, INT_ENABLE = 0x5c, INT_ENABLE = 0x5c, INT_STATUS = 0x5e, // Unused INT_STATUS = 0x5e, /* Unused */ TX_STATUS = 0x60, TX_STATUS = 0x60, MAC_CTRL = 0x6c, MAC_CTRL = 0x6c, VLAN_TAG = 0x70, // Unused VLAN_TAG = 0x70, /* Unused */ PHY_SET = 0x75, PHY_SET = 0x75, PHY_CTRL = 0x76, PHY_CTRL = 0x76, STATION_ADDRESS_0 = 0x78, STATION_ADDRESS_0 = 0x78, Loading @@ -90,11 +90,11 @@ enum ipg_regs { HASHTABLE_1 = 0x90, HASHTABLE_1 = 0x90, RMON_STATISTICS_MASK = 0x98, RMON_STATISTICS_MASK = 0x98, STATISTICS_MASK = 0x9c, STATISTICS_MASK = 0x9c, RX_JUMBO_FRAMES = 0xbc, // Unused RX_JUMBO_FRAMES = 0xbc, /* Unused */ TCP_CHECKSUM_ERRORS = 0xc0, // Unused TCP_CHECKSUM_ERRORS = 0xc0, /* Unused */ IP_CHECKSUM_ERRORS = 0xc2, // Unused IP_CHECKSUM_ERRORS = 0xc2, /* Unused */ UDP_CHECKSUM_ERRORS = 0xc4, // Unused UDP_CHECKSUM_ERRORS = 0xc4, /* Unused */ TX_JUMBO_FRAMES = 0xf4 // Unused TX_JUMBO_FRAMES = 0xf4 /* Unused */ }; }; /* Ethernet MIB statistic register offsets. */ /* Ethernet MIB statistic register offsets. */ Loading Loading @@ -590,7 +590,7 @@ enum ipg_regs { * Define larger if expecting jumbo frames. * Define larger if expecting jumbo frames. */ */ #ifdef JUMBO_FRAME #ifdef JUMBO_FRAME //IPG_TXFRAG_SIZE must <= 0x2b00, or TX will crash /* IPG_TXFRAG_SIZE must <= 0x2b00, or TX will crash */ #define IPG_TXFRAG_SIZE JUMBO_FRAME_SIZE #define IPG_TXFRAG_SIZE JUMBO_FRAME_SIZE #endif #endif Loading @@ -598,7 +598,7 @@ enum ipg_regs { * Define larger if expecting jumbo frames. * Define larger if expecting jumbo frames. */ */ #ifdef JUMBO_FRAME #ifdef JUMBO_FRAME //4088=4096-8 /* 4088 = 4096 - 8 */ #define IPG_RXFRAG_SIZE __IPG_RXFRAG_SIZE #define IPG_RXFRAG_SIZE __IPG_RXFRAG_SIZE #define IPG_RXSUPPORT_SIZE IPG_MAX_RXFRAME_SIZE #define IPG_RXSUPPORT_SIZE IPG_MAX_RXFRAME_SIZE #else #else Loading Loading @@ -628,7 +628,7 @@ enum ipg_regs { /* specify the jumbo frame maximum size /* specify the jumbo frame maximum size * per unit is 0x600 (the rx_buffer size that one RFD can carry) * per unit is 0x600 (the rx_buffer size that one RFD can carry) */ */ #define MAX_JUMBOSIZE 0x8 // max is 12K #define MAX_JUMBOSIZE 0x8 /* max is 12K */ /* Key register values loaded at driver start up. */ /* Key register values loaded at driver start up. */ Loading