Commit 8da5bb7a authored by Pekka Enberg's avatar Pekka Enberg Committed by David S. Miller

ipg: fix checkpatch reported errors

Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Cc: Francois Romieu <romieu@fr.zoreil.com>
Cc: Sorbica Shieh <sorbica@icplus.com.tw>
Cc: Jesse Huang <jesse@icplus.com.tw>
parent 9893ba16
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
IPG_AC_DMA | IPG_AC_FIFO | IPG_AC_NETWORK | IPG_AC_HOST | \ IPG_AC_DMA | IPG_AC_FIFO | IPG_AC_NETWORK | IPG_AC_HOST | \
IPG_AC_AUTO_INIT) IPG_AC_AUTO_INIT)
#define ipg_w32(val32,reg) iowrite32((val32), ioaddr + (reg)) #define ipg_w32(val32, reg) iowrite32((val32), ioaddr + (reg))
#define ipg_w16(val16,reg) iowrite16((val16), ioaddr + (reg)) #define ipg_w16(val16, reg) iowrite16((val16), ioaddr + (reg))
#define ipg_w8(val8,reg) iowrite8((val8), ioaddr + (reg)) #define ipg_w8(val8, reg) iowrite8((val8), ioaddr + (reg))
#define ipg_r32(reg) ioread32(ioaddr + (reg)) #define ipg_r32(reg) ioread32(ioaddr + (reg))
#define ipg_r16(reg) ioread16(ioaddr + (reg)) #define ipg_r16(reg) ioread16(ioaddr + (reg))
...@@ -54,20 +54,22 @@ MODULE_AUTHOR("IC Plus Corp. 2003"); ...@@ -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,
...@@ -187,7 +189,7 @@ static void send_end(void __iomem *ioaddr, u8 phyctrlpolarity) ...@@ -187,7 +189,7 @@ static void send_end(void __iomem *ioaddr, u8 phyctrlpolarity)
phyctrlpolarity) & IPG_PC_RSVD_MASK, PHY_CTRL); phyctrlpolarity) & IPG_PC_RSVD_MASK, PHY_CTRL);
} }
static u16 read_phy_bit(void __iomem * ioaddr, u8 phyctrlpolarity) static u16 read_phy_bit(void __iomem *ioaddr, u8 phyctrlpolarity)
{ {
u16 bit_data; u16 bit_data;
...@@ -204,7 +206,7 @@ static u16 read_phy_bit(void __iomem * ioaddr, u8 phyctrlpolarity) ...@@ -204,7 +206,7 @@ static u16 read_phy_bit(void __iomem * ioaddr, u8 phyctrlpolarity)
* Read a register from the Physical Layer device located * Read a register from the Physical Layer device located
* on the IPG NIC, using the IPG PHYCTRL register. * on the IPG NIC, using the IPG PHYCTRL register.
*/ */
static int mdio_read(struct net_device * dev, int phy_id, int phy_reg) static int mdio_read(struct net_device *dev, int phy_id, int phy_reg)
{ {
void __iomem *ioaddr = ipg_ioaddr(dev); void __iomem *ioaddr = ipg_ioaddr(dev);
/* /*
...@@ -1080,12 +1082,12 @@ static int ipg_nic_rxrestore(struct net_device *dev) ...@@ -1080,12 +1082,12 @@ 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,
ERROR_PACKET ERROR_PACKET
...@@ -1200,7 +1202,7 @@ static void ipg_nic_rx_with_start_and_end(struct net_device *dev, ...@@ -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;
...@@ -1208,7 +1210,7 @@ static void ipg_nic_rx_with_start_and_end(struct net_device *dev, ...@@ -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;
...@@ -1229,11 +1231,11 @@ static void ipg_nic_rx_with_start(struct net_device *dev, ...@@ -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;
...@@ -1260,7 +1262,7 @@ static void ipg_nic_rx_with_end(struct net_device *dev, ...@@ -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];
...@@ -1311,7 +1313,7 @@ static void ipg_nic_rx_no_start_no_end(struct net_device *dev, ...@@ -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];
......
...@@ -51,7 +51,7 @@ ...@@ -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,
...@@ -64,21 +64,21 @@ enum ipg_regs { ...@@ -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,
...@@ -90,11 +90,11 @@ enum ipg_regs { ...@@ -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. */
...@@ -590,7 +590,7 @@ enum ipg_regs { ...@@ -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
...@@ -598,7 +598,7 @@ enum ipg_regs { ...@@ -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
...@@ -628,7 +628,7 @@ enum ipg_regs { ...@@ -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. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment