aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ipg.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2007-11-30 02:55:43 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:53 -0500
commit8da5bb7a274559737defa400a42461e1366fc30a (patch)
tree98e1d475333d488db96eb751d9ecd511df25a5b9 /drivers/net/ipg.c
parent9893ba16c8fb9c94729061a88bdee40ecf3a3899 (diff)
ipg: fix checkpatch reported errors
Signed-off-by: Pekka 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>
Diffstat (limited to 'drivers/net/ipg.c')
-rw-r--r--drivers/net/ipg.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index 3099a7b15ecc..5d93eca07b66 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -34,9 +34,9 @@
34 IPG_AC_DMA | IPG_AC_FIFO | IPG_AC_NETWORK | IPG_AC_HOST | \ 34 IPG_AC_DMA | IPG_AC_FIFO | IPG_AC_NETWORK | IPG_AC_HOST | \
35 IPG_AC_AUTO_INIT) 35 IPG_AC_AUTO_INIT)
36 36
37#define ipg_w32(val32,reg) iowrite32((val32), ioaddr + (reg)) 37#define ipg_w32(val32, reg) iowrite32((val32), ioaddr + (reg))
38#define ipg_w16(val16,reg) iowrite16((val16), ioaddr + (reg)) 38#define ipg_w16(val16, reg) iowrite16((val16), ioaddr + (reg))
39#define ipg_w8(val8,reg) iowrite8((val8), ioaddr + (reg)) 39#define ipg_w8(val8, reg) iowrite8((val8), ioaddr + (reg))
40 40
41#define ipg_r32(reg) ioread32(ioaddr + (reg)) 41#define ipg_r32(reg) ioread32(ioaddr + (reg))
42#define ipg_r16(reg) ioread16(ioaddr + (reg)) 42#define ipg_r16(reg) ioread16(ioaddr + (reg))
@@ -54,20 +54,22 @@ MODULE_AUTHOR("IC Plus Corp. 2003");
54MODULE_DESCRIPTION("IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver"); 54MODULE_DESCRIPTION("IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver");
55MODULE_LICENSE("GPL"); 55MODULE_LICENSE("GPL");
56 56
57//variable record -- index by leading revision/length 57/*
58//Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN 58 * Variable record -- index by leading revision/length
59 * Revision/Length(=N*4), Address1, Data1, Address2, Data2,...,AddressN,DataN
60 */
59static unsigned short DefaultPhyParam[] = { 61static unsigned short DefaultPhyParam[] = {
60 // 11/12/03 IP1000A v1-3 rev=0x40 62 /* 11/12/03 IP1000A v1-3 rev=0x40 */
61 /*-------------------------------------------------------------------------- 63 /*--------------------------------------------------------------------------
62 (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 0xfff2, 64 (0x4000|(15*4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 22, 0x85bd, 24, 0xfff2,
63 27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 0x0003, 23, 0x92f6, 65 27, 0x0c10, 28, 0x0c10, 29, 0x2c10, 31, 0x0003, 23, 0x92f6,
64 31, 0x0000, 23, 0x003d, 30, 0x00de, 20, 0x20e7, 9, 0x0700, 66 31, 0x0000, 23, 0x003d, 30, 0x00de, 20, 0x20e7, 9, 0x0700,
65 --------------------------------------------------------------------------*/ 67 --------------------------------------------------------------------------*/
66 // 12/17/03 IP1000A v1-4 rev=0x40 68 /* 12/17/03 IP1000A v1-4 rev=0x40 */
67 (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 69 (0x4000 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31,
68 0x0000, 70 0x0000,
69 30, 0x005e, 9, 0x0700, 71 30, 0x005e, 9, 0x0700,
70 // 01/09/04 IP1000A v1-5 rev=0x41 72 /* 01/09/04 IP1000A v1-5 rev=0x41 */
71 (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 73 (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31,
72 0x0000, 74 0x0000,
73 30, 0x005e, 9, 0x0700, 75 30, 0x005e, 9, 0x0700,
@@ -187,7 +189,7 @@ static void send_end(void __iomem *ioaddr, u8 phyctrlpolarity)
187 phyctrlpolarity) & IPG_PC_RSVD_MASK, PHY_CTRL); 189 phyctrlpolarity) & IPG_PC_RSVD_MASK, PHY_CTRL);
188} 190}
189 191
190static u16 read_phy_bit(void __iomem * ioaddr, u8 phyctrlpolarity) 192static u16 read_phy_bit(void __iomem *ioaddr, u8 phyctrlpolarity)
191{ 193{
192 u16 bit_data; 194 u16 bit_data;
193 195
@@ -204,7 +206,7 @@ static u16 read_phy_bit(void __iomem * ioaddr, u8 phyctrlpolarity)
204 * Read a register from the Physical Layer device located 206 * Read a register from the Physical Layer device located
205 * on the IPG NIC, using the IPG PHYCTRL register. 207 * on the IPG NIC, using the IPG PHYCTRL register.
206 */ 208 */
207static int mdio_read(struct net_device * dev, int phy_id, int phy_reg) 209static int mdio_read(struct net_device *dev, int phy_id, int phy_reg)
208{ 210{
209 void __iomem *ioaddr = ipg_ioaddr(dev); 211 void __iomem *ioaddr = ipg_ioaddr(dev);
210 /* 212 /*
@@ -548,7 +550,7 @@ static int ipg_config_autoneg(struct net_device *dev)
548 printk("\n"); 550 printk("\n");
549 } else { 551 } else {
550 /* Configure IPG for half duplex operation. */ 552 /* Configure IPG for half duplex operation. */
551 printk(KERN_INFO "%s: setting half duplex, " 553 printk(KERN_INFO "%s: setting half duplex, "
552 "no TX flow control, no RX flow control.\n", dev->name); 554 "no TX flow control, no RX flow control.\n", dev->name);
553 555
554 mac_ctrl_val &= ~IPG_MC_DUPLEX_SELECT_FD & 556 mac_ctrl_val &= ~IPG_MC_DUPLEX_SELECT_FD &
@@ -1080,12 +1082,12 @@ static int ipg_nic_rxrestore(struct net_device *dev)
1080#ifdef JUMBO_FRAME 1082#ifdef JUMBO_FRAME
1081 1083
1082/* use jumboindex and jumbosize to control jumbo frame status 1084/* use jumboindex and jumbosize to control jumbo frame status
1083 initial status is jumboindex=-1 and jumbosize=0 1085 * initial status is jumboindex=-1 and jumbosize=0
1084 1. jumboindex = -1 and jumbosize=0 : previous jumbo frame has been done. 1086 * 1. jumboindex = -1 and jumbosize=0 : previous jumbo frame has been done.
1085 2. jumboindex != -1 and jumbosize != 0 : jumbo frame is not over size and receiving 1087 * 2. jumboindex != -1 and jumbosize != 0 : jumbo frame is not over size and receiving
1086 3. jumboindex = -1 and jumbosize != 0 : jumbo frame is over size, already dump 1088 * 3. jumboindex = -1 and jumbosize != 0 : jumbo frame is over size, already dump
1087 previous receiving and need to continue dumping the current one 1089 * previous receiving and need to continue dumping the current one
1088*/ 1090 */
1089enum { 1091enum {
1090 NORMAL_PACKET, 1092 NORMAL_PACKET,
1091 ERROR_PACKET 1093 ERROR_PACKET
@@ -1200,7 +1202,7 @@ static void ipg_nic_rx_with_start_and_end(struct net_device *dev,
1200 jumbo->skb = NULL; 1202 jumbo->skb = NULL;
1201 } 1203 }
1202 1204
1203 // 1: found error, 0 no error 1205 /* 1: found error, 0 no error */
1204 if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) 1206 if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET)
1205 return; 1207 return;
1206 1208
@@ -1208,7 +1210,7 @@ static void ipg_nic_rx_with_start_and_end(struct net_device *dev,
1208 if (!skb) 1210 if (!skb)
1209 return; 1211 return;
1210 1212
1211 // accept this frame and send to upper layer 1213 /* accept this frame and send to upper layer */
1212 framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN; 1214 framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN;
1213 if (framelen > IPG_RXFRAG_SIZE) 1215 if (framelen > IPG_RXFRAG_SIZE)
1214 framelen = IPG_RXFRAG_SIZE; 1216 framelen = IPG_RXFRAG_SIZE;
@@ -1229,11 +1231,11 @@ static void ipg_nic_rx_with_start(struct net_device *dev,
1229 struct pci_dev *pdev = sp->pdev; 1231 struct pci_dev *pdev = sp->pdev;
1230 struct sk_buff *skb; 1232 struct sk_buff *skb;
1231 1233
1232 // 1: found error, 0 no error 1234 /* 1: found error, 0 no error */
1233 if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET) 1235 if (ipg_nic_rx_check_error(dev) != NORMAL_PACKET)
1234 return; 1236 return;
1235 1237
1236 // accept this frame and send to upper layer 1238 /* accept this frame and send to upper layer */
1237 skb = sp->rx_buff[entry]; 1239 skb = sp->rx_buff[entry];
1238 if (!skb) 1240 if (!skb)
1239 return; 1241 return;
@@ -1260,7 +1262,7 @@ static void ipg_nic_rx_with_end(struct net_device *dev,
1260{ 1262{
1261 struct ipg_jumbo *jumbo = &sp->jumbo; 1263 struct ipg_jumbo *jumbo = &sp->jumbo;
1262 1264
1263 //1: found error, 0 no error 1265 /* 1: found error, 0 no error */
1264 if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { 1266 if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) {
1265 struct sk_buff *skb = sp->rx_buff[entry]; 1267 struct sk_buff *skb = sp->rx_buff[entry];
1266 1268
@@ -1311,7 +1313,7 @@ static void ipg_nic_rx_no_start_no_end(struct net_device *dev,
1311{ 1313{
1312 struct ipg_jumbo *jumbo = &sp->jumbo; 1314 struct ipg_jumbo *jumbo = &sp->jumbo;
1313 1315
1314 //1: found error, 0 no error 1316 /* 1: found error, 0 no error */
1315 if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) { 1317 if (ipg_nic_rx_check_error(dev) == NORMAL_PACKET) {
1316 struct sk_buff *skb = sp->rx_buff[entry]; 1318 struct sk_buff *skb = sp->rx_buff[entry];
1317 1319