aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amd/amd8111e.c
diff options
context:
space:
mode:
authorVarka Bhadram <varkab@cdac.in>2014-07-14 04:39:09 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-14 22:14:15 -0400
commit46c73ecc6168586c7628b87ac1d0436eca9574dd (patch)
tree746c9a42cc70e1a0ac3e4656aff79def55d7bfa2 /drivers/net/ethernet/amd/amd8111e.c
parentba69a3d78e4f51e65933a86b8b107c86709bb2f5 (diff)
ethernet: amd: fix 'foo* bar'
This patch fix the 'foo*' bar with 'foo *bar' and (foo*) with (foo *). Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/amd8111e.c')
-rw-r--r--drivers/net/ethernet/amd/amd8111e.c76
1 files changed, 40 insertions, 36 deletions
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index 9f8a15e3b8bb..841e6558db68 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -109,7 +109,8 @@ module_param_array(dynamic_ipg, bool, NULL, 0);
109MODULE_PARM_DESC(dynamic_ipg, "Enable or Disable dynamic IPG, 1: Enable, 0: Disable"); 109MODULE_PARM_DESC(dynamic_ipg, "Enable or Disable dynamic IPG, 1: Enable, 0: Disable");
110 110
111/* This function will read the PHY registers. */ 111/* This function will read the PHY registers. */
112static int amd8111e_read_phy(struct amd8111e_priv* lp, int phy_id, int reg, u32* val) 112static int amd8111e_read_phy(struct amd8111e_priv *lp,
113 int phy_id, int reg, u32 *val)
113{ 114{
114 void __iomem *mmio = lp->mmio; 115 void __iomem *mmio = lp->mmio;
115 unsigned int reg_val; 116 unsigned int reg_val;
@@ -137,7 +138,8 @@ err_phy_read:
137} 138}
138 139
139/* This function will write into PHY registers. */ 140/* This function will write into PHY registers. */
140static int amd8111e_write_phy(struct amd8111e_priv* lp,int phy_id, int reg, u32 val) 141static int amd8111e_write_phy(struct amd8111e_priv *lp,
142 int phy_id, int reg, u32 val)
141{ 143{
142 unsigned int repeat = REPEAT_CNT; 144 unsigned int repeat = REPEAT_CNT;
143 void __iomem *mmio = lp->mmio; 145 void __iomem *mmio = lp->mmio;
@@ -166,9 +168,9 @@ err_phy_write:
166} 168}
167 169
168/* This is the mii register read function provided to the mii interface. */ 170/* This is the mii register read function provided to the mii interface. */
169static int amd8111e_mdio_read(struct net_device * dev, int phy_id, int reg_num) 171static int amd8111e_mdio_read(struct net_device *dev, int phy_id, int reg_num)
170{ 172{
171 struct amd8111e_priv* lp = netdev_priv(dev); 173 struct amd8111e_priv *lp = netdev_priv(dev);
172 unsigned int reg_val; 174 unsigned int reg_val;
173 175
174 amd8111e_read_phy(lp,phy_id,reg_num,&reg_val); 176 amd8111e_read_phy(lp,phy_id,reg_num,&reg_val);
@@ -177,9 +179,10 @@ static int amd8111e_mdio_read(struct net_device * dev, int phy_id, int reg_num)
177} 179}
178 180
179/* This is the mii register write function provided to the mii interface. */ 181/* This is the mii register write function provided to the mii interface. */
180static void amd8111e_mdio_write(struct net_device * dev, int phy_id, int reg_num, int val) 182static void amd8111e_mdio_write(struct net_device *dev,
183 int phy_id, int reg_num, int val)
181{ 184{
182 struct amd8111e_priv* lp = netdev_priv(dev); 185 struct amd8111e_priv *lp = netdev_priv(dev);
183 186
184 amd8111e_write_phy(lp, phy_id, reg_num, val); 187 amd8111e_write_phy(lp, phy_id, reg_num, val);
185} 188}
@@ -231,7 +234,7 @@ static void amd8111e_set_ext_phy(struct net_device *dev)
231static int amd8111e_free_skbs(struct net_device *dev) 234static int amd8111e_free_skbs(struct net_device *dev)
232{ 235{
233 struct amd8111e_priv *lp = netdev_priv(dev); 236 struct amd8111e_priv *lp = netdev_priv(dev);
234 struct sk_buff* rx_skbuff; 237 struct sk_buff *rx_skbuff;
235 int i; 238 int i;
236 239
237 /* Freeing transmit skbs */ 240 /* Freeing transmit skbs */
@@ -261,9 +264,9 @@ static int amd8111e_free_skbs(struct net_device *dev)
261/* This will set the receive buffer length corresponding 264/* This will set the receive buffer length corresponding
262 * to the mtu size of networkinterface. 265 * to the mtu size of networkinterface.
263 */ 266 */
264static inline void amd8111e_set_rx_buff_len(struct net_device* dev) 267static inline void amd8111e_set_rx_buff_len(struct net_device *dev)
265{ 268{
266 struct amd8111e_priv* lp = netdev_priv(dev); 269 struct amd8111e_priv *lp = netdev_priv(dev);
267 unsigned int mtu = dev->mtu; 270 unsigned int mtu = dev->mtu;
268 271
269 if (mtu > ETH_DATA_LEN){ 272 if (mtu > ETH_DATA_LEN){
@@ -366,14 +369,14 @@ err_no_mem:
366/* This function will set the interrupt coalescing according 369/* This function will set the interrupt coalescing according
367 * to the input arguments 370 * to the input arguments
368 */ 371 */
369static int amd8111e_set_coalesce(struct net_device * dev, enum coal_mode cmod) 372static int amd8111e_set_coalesce(struct net_device *dev, enum coal_mode cmod)
370{ 373{
371 unsigned int timeout; 374 unsigned int timeout;
372 unsigned int event_count; 375 unsigned int event_count;
373 376
374 struct amd8111e_priv *lp = netdev_priv(dev); 377 struct amd8111e_priv *lp = netdev_priv(dev);
375 void __iomem *mmio = lp->mmio; 378 void __iomem *mmio = lp->mmio;
376 struct amd8111e_coalesce_conf * coal_conf = &lp->coal_conf; 379 struct amd8111e_coalesce_conf *coal_conf = &lp->coal_conf;
377 380
378 381
379 switch(cmod) 382 switch(cmod)
@@ -502,7 +505,7 @@ static int amd8111e_restart(struct net_device *dev)
502} 505}
503 506
504/* This function clears necessary the device registers. */ 507/* This function clears necessary the device registers. */
505static void amd8111e_init_hw_default( struct amd8111e_priv* lp) 508static void amd8111e_init_hw_default(struct amd8111e_priv *lp)
506{ 509{
507 unsigned int reg_val; 510 unsigned int reg_val;
508 unsigned int logic_filter[2] ={0,}; 511 unsigned int logic_filter[2] ={0,};
@@ -572,7 +575,7 @@ static void amd8111e_init_hw_default( struct amd8111e_priv* lp)
572 writew(MIB_CLEAR, mmio + MIB_ADDR); 575 writew(MIB_CLEAR, mmio + MIB_ADDR);
573 576
574 /* Clear LARF */ 577 /* Clear LARF */
575 amd8111e_writeq(*(u64*)logic_filter,mmio+LADRF); 578 amd8111e_writeq(*(u64 *)logic_filter, mmio + LADRF);
576 579
577 /* SRAM_SIZE register */ 580 /* SRAM_SIZE register */
578 reg_val = readl(mmio + SRAM_SIZE); 581 reg_val = readl(mmio + SRAM_SIZE);
@@ -593,7 +596,7 @@ static void amd8111e_init_hw_default( struct amd8111e_priv* lp)
593/* This function disables the interrupt and clears all the pending 596/* This function disables the interrupt and clears all the pending
594 * interrupts in INT0 597 * interrupts in INT0
595 */ 598 */
596static void amd8111e_disable_interrupt(struct amd8111e_priv* lp) 599static void amd8111e_disable_interrupt(struct amd8111e_priv *lp)
597{ 600{
598 u32 intr0; 601 u32 intr0;
599 602
@@ -610,7 +613,7 @@ static void amd8111e_disable_interrupt(struct amd8111e_priv* lp)
610} 613}
611 614
612/* This function stops the chip. */ 615/* This function stops the chip. */
613static void amd8111e_stop_chip(struct amd8111e_priv* lp) 616static void amd8111e_stop_chip(struct amd8111e_priv *lp)
614{ 617{
615 writel(RUN, lp->mmio + CMD0); 618 writel(RUN, lp->mmio + CMD0);
616 619
@@ -619,7 +622,7 @@ static void amd8111e_stop_chip(struct amd8111e_priv* lp)
619} 622}
620 623
621/* This function frees the transmiter and receiver descriptor rings. */ 624/* This function frees the transmiter and receiver descriptor rings. */
622static void amd8111e_free_ring(struct amd8111e_priv* lp) 625static void amd8111e_free_ring(struct amd8111e_priv *lp)
623{ 626{
624 /* Free transmit and receive descriptor rings */ 627 /* Free transmit and receive descriptor rings */
625 if(lp->rx_ring){ 628 if(lp->rx_ring){
@@ -645,7 +648,7 @@ static void amd8111e_free_ring(struct amd8111e_priv* lp)
645 */ 648 */
646static int amd8111e_tx(struct net_device *dev) 649static int amd8111e_tx(struct net_device *dev)
647{ 650{
648 struct amd8111e_priv* lp = netdev_priv(dev); 651 struct amd8111e_priv *lp = netdev_priv(dev);
649 int tx_index = lp->tx_complete_idx & TX_RING_DR_MOD_MASK; 652 int tx_index = lp->tx_complete_idx & TX_RING_DR_MOD_MASK;
650 int status; 653 int status;
651 /* Complete all the transmit packet */ 654 /* Complete all the transmit packet */
@@ -815,7 +818,7 @@ rx_not_empty:
815} 818}
816 819
817/* This function will indicate the link status to the kernel. */ 820/* This function will indicate the link status to the kernel. */
818static int amd8111e_link_change(struct net_device* dev) 821static int amd8111e_link_change(struct net_device *dev)
819{ 822{
820 struct amd8111e_priv *lp = netdev_priv(dev); 823 struct amd8111e_priv *lp = netdev_priv(dev);
821 int status0,speed; 824 int status0,speed;
@@ -979,7 +982,7 @@ static struct net_device_stats *amd8111e_get_stats(struct net_device *dev)
979static int amd8111e_calc_coalesce(struct net_device *dev) 982static int amd8111e_calc_coalesce(struct net_device *dev)
980{ 983{
981 struct amd8111e_priv *lp = netdev_priv(dev); 984 struct amd8111e_priv *lp = netdev_priv(dev);
982 struct amd8111e_coalesce_conf * coal_conf = &lp->coal_conf; 985 struct amd8111e_coalesce_conf *coal_conf = &lp->coal_conf;
983 int tx_pkt_rate; 986 int tx_pkt_rate;
984 int rx_pkt_rate; 987 int rx_pkt_rate;
985 int tx_data_rate; 988 int tx_data_rate;
@@ -1114,7 +1117,7 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
1114static irqreturn_t amd8111e_interrupt(int irq, void *dev_id) 1117static irqreturn_t amd8111e_interrupt(int irq, void *dev_id)
1115{ 1118{
1116 1119
1117 struct net_device * dev = (struct net_device *) dev_id; 1120 struct net_device *dev = (struct net_device *)dev_id;
1118 struct amd8111e_priv *lp = netdev_priv(dev); 1121 struct amd8111e_priv *lp = netdev_priv(dev);
1119 void __iomem *mmio = lp->mmio; 1122 void __iomem *mmio = lp->mmio;
1120 unsigned int intr0, intren0; 1123 unsigned int intr0, intren0;
@@ -1191,7 +1194,7 @@ static void amd8111e_poll(struct net_device *dev)
1191 * the statistics so that most recent statistics will be 1194 * the statistics so that most recent statistics will be
1192 * available after the interface is down. 1195 * available after the interface is down.
1193 */ 1196 */
1194static int amd8111e_close(struct net_device * dev) 1197static int amd8111e_close(struct net_device *dev)
1195{ 1198{
1196 struct amd8111e_priv *lp = netdev_priv(dev); 1199 struct amd8111e_priv *lp = netdev_priv(dev);
1197 netif_stop_queue(dev); 1200 netif_stop_queue(dev);
@@ -1225,7 +1228,7 @@ static int amd8111e_close(struct net_device * dev)
1225/* This function opens new interface.It requests irq for the device, 1228/* This function opens new interface.It requests irq for the device,
1226 * initializes the device,buffers and descriptors, and starts the device. 1229 * initializes the device,buffers and descriptors, and starts the device.
1227 */ 1230 */
1228static int amd8111e_open(struct net_device * dev ) 1231static int amd8111e_open(struct net_device *dev)
1229{ 1232{
1230 struct amd8111e_priv *lp = netdev_priv(dev); 1233 struct amd8111e_priv *lp = netdev_priv(dev);
1231 1234
@@ -1264,7 +1267,7 @@ static int amd8111e_open(struct net_device * dev )
1264/* This function checks if there is any transmit descriptors 1267/* This function checks if there is any transmit descriptors
1265 * available to queue more packet. 1268 * available to queue more packet.
1266 */ 1269 */
1267static int amd8111e_tx_queue_avail(struct amd8111e_priv* lp ) 1270static int amd8111e_tx_queue_avail(struct amd8111e_priv *lp)
1268{ 1271{
1269 int tx_index = lp->tx_idx & TX_BUFF_MOD_MASK; 1272 int tx_index = lp->tx_idx & TX_BUFF_MOD_MASK;
1270 if (lp->tx_skbuff[tx_index]) 1273 if (lp->tx_skbuff[tx_index])
@@ -1280,7 +1283,7 @@ static int amd8111e_tx_queue_avail(struct amd8111e_priv* lp )
1280 * byte count, ownership to hardware etc. 1283 * byte count, ownership to hardware etc.
1281 */ 1284 */
1282static netdev_tx_t amd8111e_start_xmit(struct sk_buff *skb, 1285static netdev_tx_t amd8111e_start_xmit(struct sk_buff *skb,
1283 struct net_device * dev) 1286 struct net_device *dev)
1284{ 1287{
1285 struct amd8111e_priv *lp = netdev_priv(dev); 1288 struct amd8111e_priv *lp = netdev_priv(dev);
1286 int tx_index; 1289 int tx_index;
@@ -1368,14 +1371,14 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
1368 /* get all multicast packet */ 1371 /* get all multicast packet */
1369 mc_filter[1] = mc_filter[0] = 0xffffffff; 1372 mc_filter[1] = mc_filter[0] = 0xffffffff;
1370 lp->options |= OPTION_MULTICAST_ENABLE; 1373 lp->options |= OPTION_MULTICAST_ENABLE;
1371 amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); 1374 amd8111e_writeq(*(u64 *)mc_filter, lp->mmio + LADRF);
1372 return; 1375 return;
1373 } 1376 }
1374 if (netdev_mc_empty(dev)) { 1377 if (netdev_mc_empty(dev)) {
1375 /* get only own packets */ 1378 /* get only own packets */
1376 mc_filter[1] = mc_filter[0] = 0; 1379 mc_filter[1] = mc_filter[0] = 0;
1377 lp->options &= ~OPTION_MULTICAST_ENABLE; 1380 lp->options &= ~OPTION_MULTICAST_ENABLE;
1378 amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); 1381 amd8111e_writeq(*(u64 *)mc_filter, lp->mmio + LADRF);
1379 /* disable promiscuous mode */ 1382 /* disable promiscuous mode */
1380 writel(PROM, lp->mmio + CMD2); 1383 writel(PROM, lp->mmio + CMD2);
1381 return; 1384 return;
@@ -1387,14 +1390,15 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
1387 bit_num = (ether_crc_le(ETH_ALEN, ha->addr) >> 26) & 0x3f; 1390 bit_num = (ether_crc_le(ETH_ALEN, ha->addr) >> 26) & 0x3f;
1388 mc_filter[bit_num >> 5] |= 1 << (bit_num & 31); 1391 mc_filter[bit_num >> 5] |= 1 << (bit_num & 31);
1389 } 1392 }
1390 amd8111e_writeq(*(u64*)mc_filter,lp->mmio+ LADRF); 1393 amd8111e_writeq(*(u64 *)mc_filter, lp->mmio + LADRF);
1391 1394
1392 /* To eliminate PCI posting bug */ 1395 /* To eliminate PCI posting bug */
1393 readl(lp->mmio + CMD2); 1396 readl(lp->mmio + CMD2);
1394 1397
1395} 1398}
1396 1399
1397static void amd8111e_get_drvinfo(struct net_device* dev, struct ethtool_drvinfo *info) 1400static void amd8111e_get_drvinfo(struct net_device *dev,
1401 struct ethtool_drvinfo *info)
1398{ 1402{
1399 struct amd8111e_priv *lp = netdev_priv(dev); 1403 struct amd8111e_priv *lp = netdev_priv(dev);
1400 struct pci_dev *pci_dev = lp->pci_dev; 1404 struct pci_dev *pci_dev = lp->pci_dev;
@@ -1490,7 +1494,7 @@ static const struct ethtool_ops ops = {
1490 * gets/sets driver speed, gets memory mapped register values, forces 1494 * gets/sets driver speed, gets memory mapped register values, forces
1491 * auto negotiation, sets/gets WOL options for ethtool application. 1495 * auto negotiation, sets/gets WOL options for ethtool application.
1492 */ 1496 */
1493static int amd8111e_ioctl(struct net_device * dev , struct ifreq *ifr, int cmd) 1497static int amd8111e_ioctl(struct net_device *dev , struct ifreq *ifr, int cmd)
1494{ 1498{
1495 struct mii_ioctl_data *data = if_mii(ifr); 1499 struct mii_ioctl_data *data = if_mii(ifr);
1496 struct amd8111e_priv *lp = netdev_priv(dev); 1500 struct amd8111e_priv *lp = netdev_priv(dev);
@@ -1577,7 +1581,7 @@ static int amd8111e_change_mtu(struct net_device *dev, int new_mtu)
1577 return err; 1581 return err;
1578} 1582}
1579 1583
1580static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp) 1584static int amd8111e_enable_magicpkt(struct amd8111e_priv *lp)
1581{ 1585{
1582 writel( VAL1|MPPLBA, lp->mmio + CMD3); 1586 writel( VAL1|MPPLBA, lp->mmio + CMD3);
1583 writel( VAL0|MPEN_SW, lp->mmio + CMD7); 1587 writel( VAL0|MPEN_SW, lp->mmio + CMD7);
@@ -1587,7 +1591,7 @@ static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp)
1587 return 0; 1591 return 0;
1588} 1592}
1589 1593
1590static int amd8111e_enable_link_change(struct amd8111e_priv* lp) 1594static int amd8111e_enable_link_change(struct amd8111e_priv *lp)
1591{ 1595{
1592 1596
1593 /* Adapter is already stoped/suspended/interrupt-disabled */ 1597 /* Adapter is already stoped/suspended/interrupt-disabled */
@@ -1605,7 +1609,7 @@ static int amd8111e_enable_link_change(struct amd8111e_priv* lp)
1605 */ 1609 */
1606static void amd8111e_tx_timeout(struct net_device *dev) 1610static void amd8111e_tx_timeout(struct net_device *dev)
1607{ 1611{
1608 struct amd8111e_priv* lp = netdev_priv(dev); 1612 struct amd8111e_priv *lp = netdev_priv(dev);
1609 int err; 1613 int err;
1610 1614
1611 netdev_err(dev, "transmit timed out, resetting\n"); 1615 netdev_err(dev, "transmit timed out, resetting\n");
@@ -1686,10 +1690,10 @@ static int amd8111e_resume(struct pci_dev *pci_dev)
1686 return 0; 1690 return 0;
1687} 1691}
1688 1692
1689static void amd8111e_config_ipg(struct net_device* dev) 1693static void amd8111e_config_ipg(struct net_device *dev)
1690{ 1694{
1691 struct amd8111e_priv *lp = netdev_priv(dev); 1695 struct amd8111e_priv *lp = netdev_priv(dev);
1692 struct ipg_info* ipg_data = &lp->ipg_data; 1696 struct ipg_info *ipg_data = &lp->ipg_data;
1693 void __iomem *mmio = lp->mmio; 1697 void __iomem *mmio = lp->mmio;
1694 unsigned int prev_col_cnt = ipg_data->col_cnt; 1698 unsigned int prev_col_cnt = ipg_data->col_cnt;
1695 unsigned int total_col_cnt; 1699 unsigned int total_col_cnt;
@@ -1787,8 +1791,8 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
1787{ 1791{
1788 int err, i; 1792 int err, i;
1789 unsigned long reg_addr,reg_len; 1793 unsigned long reg_addr,reg_len;
1790 struct amd8111e_priv* lp; 1794 struct amd8111e_priv *lp;
1791 struct net_device* dev; 1795 struct net_device *dev;
1792 1796
1793 err = pci_enable_device(pdev); 1797 err = pci_enable_device(pdev);
1794 if(err){ 1798 if(err){