aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/xilinx/xilinx_emaclite.c
diff options
context:
space:
mode:
authorRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>2018-06-28 09:11:49 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-30 07:15:44 -0400
commit49a83f002731dbfacb292d66399c828eb1e9f50f (patch)
tree382370eceb8e7b0573461c7a0ad582cd65a629c5 /drivers/net/ethernet/xilinx/xilinx_emaclite.c
parentf713d50f33c1fbd1046832f30cf95921840a0150 (diff)
net: emaclite: Fix block comments style
This patch fixes below checkpatch warnings- WARNING: Block comments use a trailing */ on a separate line WARNING: Block comments use * on subsequent lines WARNING: networking block comments don't use an empty /* line, use /* Comment Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/xilinx/xilinx_emaclite.c')
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_emaclite.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index a17f0b60810e..f96c9209039b 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -70,7 +70,8 @@
70#define XEL_TSR_XMIT_IE_MASK 0x00000008 /* Tx interrupt enable bit */ 70#define XEL_TSR_XMIT_IE_MASK 0x00000008 /* Tx interrupt enable bit */
71#define XEL_TSR_XMIT_ACTIVE_MASK 0x80000000 /* Buffer is active, SW bit 71#define XEL_TSR_XMIT_ACTIVE_MASK 0x80000000 /* Buffer is active, SW bit
72 * only. This is not documented 72 * only. This is not documented
73 * in the HW spec */ 73 * in the HW spec
74 */
74 75
75/* Define for programming the MAC address into the EmacLite */ 76/* Define for programming the MAC address into the EmacLite */
76#define XEL_TSR_PROG_MAC_ADDR (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_PROGRAM_MASK) 77#define XEL_TSR_PROG_MAC_ADDR (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_PROGRAM_MASK)
@@ -336,7 +337,8 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data,
336 drvdata->next_tx_buf_to_use ^= XEL_BUFFER_OFFSET; 337 drvdata->next_tx_buf_to_use ^= XEL_BUFFER_OFFSET;
337 } else if (drvdata->tx_ping_pong != 0) { 338 } else if (drvdata->tx_ping_pong != 0) {
338 /* If the expected buffer is full, try the other buffer, 339 /* If the expected buffer is full, try the other buffer,
339 * if it is configured in HW */ 340 * if it is configured in HW
341 */
340 342
341 addr = (void __iomem __force *)((u32 __force)addr ^ 343 addr = (void __iomem __force *)((u32 __force)addr ^
342 XEL_BUFFER_OFFSET); 344 XEL_BUFFER_OFFSET);
@@ -357,7 +359,8 @@ static int xemaclite_send_data(struct net_local *drvdata, u8 *data,
357 /* Update the Tx Status Register to indicate that there is a 359 /* Update the Tx Status Register to indicate that there is a
358 * frame to send. Set the XEL_TSR_XMIT_ACTIVE_MASK flag which 360 * frame to send. Set the XEL_TSR_XMIT_ACTIVE_MASK flag which
359 * is used by the interrupt handler to check whether a frame 361 * is used by the interrupt handler to check whether a frame
360 * has been transmitted */ 362 * has been transmitted
363 */
361 reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET); 364 reg_data = xemaclite_readl(addr + XEL_TSR_OFFSET);
362 reg_data |= (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_XMIT_ACTIVE_MASK); 365 reg_data |= (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_XMIT_ACTIVE_MASK);
363 xemaclite_writel(reg_data, addr + XEL_TSR_OFFSET); 366 xemaclite_writel(reg_data, addr + XEL_TSR_OFFSET);
@@ -395,7 +398,8 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data, int maxlen)
395 /* The instance is out of sync, try other buffer if other 398 /* The instance is out of sync, try other buffer if other
396 * buffer is configured, return 0 otherwise. If the instance is 399 * buffer is configured, return 0 otherwise. If the instance is
397 * out of sync, do not update the 'next_rx_buf_to_use' since it 400 * out of sync, do not update the 'next_rx_buf_to_use' since it
398 * will correct on subsequent calls */ 401 * will correct on subsequent calls
402 */
399 if (drvdata->rx_ping_pong != 0) 403 if (drvdata->rx_ping_pong != 0)
400 addr = (void __iomem __force *)((u32 __force)addr ^ 404 addr = (void __iomem __force *)((u32 __force)addr ^
401 XEL_BUFFER_OFFSET); 405 XEL_BUFFER_OFFSET);
@@ -409,13 +413,15 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data, int maxlen)
409 return 0; /* No data was available */ 413 return 0; /* No data was available */
410 } 414 }
411 415
412 /* Get the protocol type of the ethernet frame that arrived */ 416 /* Get the protocol type of the ethernet frame that arrived
417 */
413 proto_type = ((ntohl(xemaclite_readl(addr + XEL_HEADER_OFFSET + 418 proto_type = ((ntohl(xemaclite_readl(addr + XEL_HEADER_OFFSET +
414 XEL_RXBUFF_OFFSET)) >> XEL_HEADER_SHIFT) & 419 XEL_RXBUFF_OFFSET)) >> XEL_HEADER_SHIFT) &
415 XEL_RPLR_LENGTH_MASK); 420 XEL_RPLR_LENGTH_MASK);
416 421
417 /* Check if received ethernet frame is a raw ethernet frame 422 /* Check if received ethernet frame is a raw ethernet frame
418 * or an IP packet or an ARP packet */ 423 * or an IP packet or an ARP packet
424 */
419 if (proto_type > ETH_DATA_LEN) { 425 if (proto_type > ETH_DATA_LEN) {
420 426
421 if (proto_type == ETH_P_IP) { 427 if (proto_type == ETH_P_IP) {
@@ -431,7 +437,8 @@ static u16 xemaclite_recv_data(struct net_local *drvdata, u8 *data, int maxlen)
431 length = XEL_ARP_PACKET_SIZE + ETH_HLEN + ETH_FCS_LEN; 437 length = XEL_ARP_PACKET_SIZE + ETH_HLEN + ETH_FCS_LEN;
432 else 438 else
433 /* Field contains type other than IP or ARP, use max 439 /* Field contains type other than IP or ARP, use max
434 * frame size and let user parse it */ 440 * frame size and let user parse it
441 */
435 length = ETH_FRAME_LEN + ETH_FCS_LEN; 442 length = ETH_FRAME_LEN + ETH_FCS_LEN;
436 } else 443 } else
437 /* Use the length in the frame, plus the header and trailer */ 444 /* Use the length in the frame, plus the header and trailer */
@@ -602,11 +609,11 @@ static void xemaclite_rx_handler(struct net_device *dev)
602 return; 609 return;
603 } 610 }
604 611
605 /* 612 /* A new skb should have the data halfword aligned, but this code is
606 * A new skb should have the data halfword aligned, but this code is
607 * here just in case that isn't true. Calculate how many 613 * here just in case that isn't true. Calculate how many
608 * bytes we should reserve to get the data to start on a word 614 * bytes we should reserve to get the data to start on a word
609 * boundary */ 615 * boundary
616 */
610 align = BUFFER_ALIGN(skb->data); 617 align = BUFFER_ALIGN(skb->data);
611 if (align) 618 if (align)
612 skb_reserve(skb, align); 619 skb_reserve(skb, align);
@@ -708,8 +715,8 @@ static int xemaclite_mdio_wait(struct net_local *lp)
708 unsigned long end = jiffies + 2; 715 unsigned long end = jiffies + 2;
709 716
710 /* wait for the MDIO interface to not be busy or timeout 717 /* wait for the MDIO interface to not be busy or timeout
711 after some time. 718 * after some time.
712 */ 719 */
713 while (xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) & 720 while (xemaclite_readl(lp->base_addr + XEL_MDIOCTRL_OFFSET) &
714 XEL_MDIOCTRL_MDIOSTS_MASK) { 721 XEL_MDIOCTRL_MDIOSTS_MASK) {
715 if (time_before_eq(end, jiffies)) { 722 if (time_before_eq(end, jiffies)) {
@@ -1029,7 +1036,8 @@ static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
1029 if (xemaclite_send_data(lp, (u8 *) new_skb->data, len) != 0) { 1036 if (xemaclite_send_data(lp, (u8 *) new_skb->data, len) != 0) {
1030 /* If the Emaclite Tx buffer is busy, stop the Tx queue and 1037 /* If the Emaclite Tx buffer is busy, stop the Tx queue and
1031 * defer the skb for transmission during the ISR, after the 1038 * defer the skb for transmission during the ISR, after the
1032 * current transmission is complete */ 1039 * current transmission is complete
1040 */
1033 netif_stop_queue(dev); 1041 netif_stop_queue(dev);
1034 lp->deferred_skb = new_skb; 1042 lp->deferred_skb = new_skb;
1035 /* Take the time stamp now, since we can't do this in an ISR. */ 1043 /* Take the time stamp now, since we can't do this in an ISR. */