From ac937e1f7d7a7a986b39432f7a9e8a09a0c5a8c7 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 24 Aug 2020 21:56:15 -0700 Subject: wan: sbni: Avoid comma separated statements Use semicolons and braces. Signed-off-by: Joe Perches Signed-off-by: David S. Miller --- drivers/net/wan/sbni.c | 101 ++++++++++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 43 deletions(-) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 40c04ea1200a..2fde439543fb 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c @@ -260,11 +260,12 @@ static int __init sbni_init(struct net_device *dev) return sbni_isa_probe( dev ); /* otherwise we have to perform search our adapter */ - if( io[ num ] != -1 ) - dev->base_addr = io[ num ], + if( io[ num ] != -1 ) { + dev->base_addr = io[ num ]; dev->irq = irq[ num ]; - else if( scandone || io[ 0 ] != -1 ) + } else if( scandone || io[ 0 ] != -1 ) { return -ENODEV; + } /* if io[ num ] contains non-zero address, then that is on ISA bus */ if( dev->base_addr ) @@ -399,12 +400,13 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) nl->maxframe = DEFAULT_FRAME_LEN; nl->csr1.rate = baud[ num ]; - if( (nl->cur_rxl_index = rxl[ num ]) == -1 ) + if( (nl->cur_rxl_index = rxl[ num ]) == -1 ) { /* autotune rxl */ - nl->cur_rxl_index = DEF_RXL, + nl->cur_rxl_index = DEF_RXL; nl->delta_rxl = DEF_RXL_DELTA; - else + } else { nl->delta_rxl = 0; + } nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ]; if( inb( ioaddr + CSR0 ) & 0x01 ) nl->state |= FL_SLOW_MODE; @@ -512,13 +514,15 @@ sbni_interrupt( int irq, void *dev_id ) do { repeat = 0; - if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) ) - handle_channel( dev ), + if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) ) { + handle_channel( dev ); repeat = 1; + } if( nl->second && /* second channel present */ - (inb( nl->second->base_addr+CSR0 ) & (RC_RDY | TR_RDY)) ) - handle_channel( nl->second ), + (inb( nl->second->base_addr+CSR0 ) & (RC_RDY | TR_RDY)) ) { + handle_channel( nl->second ); repeat = 1; + } } while( repeat ); if( nl->second ) @@ -610,11 +614,12 @@ recv_frame( struct net_device *dev ) nl->state |= FL_PREV_OK; if( framelen > 4 ) nl->in_stats.all_rx_number++; - } else - nl->state &= ~FL_PREV_OK, - change_level( dev ), - nl->in_stats.all_rx_number++, + } else { + nl->state &= ~FL_PREV_OK; + change_level( dev ); + nl->in_stats.all_rx_number++; nl->in_stats.bad_rx_number++; + } return !frame_ok || framelen > 4; } @@ -689,9 +694,10 @@ download_data( struct net_device *dev, u32 *crc_p ) *crc_p = calc_crc32( *crc_p, skb->data + nl->outpos, len ); /* if packet too short we should write some more bytes to pad */ - for( len = nl->framelen - len; len--; ) - outb( 0, dev->base_addr + DAT ), + for( len = nl->framelen - len; len--; ) { + outb( 0, dev->base_addr + DAT ); *crc_p = CRC32( 0, *crc_p ); + } } @@ -703,9 +709,10 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno, int frame_ok; - if( is_first ) - nl->wait_frameno = frameno, + if( is_first ) { + nl->wait_frameno = frameno; nl->inppos = 0; + } if( nl->wait_frameno == frameno ) { @@ -717,33 +724,35 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno, * error was occurred... drop entire packet */ else if( (frame_ok = skip_tail( dev->base_addr, framelen, crc )) - != 0 ) - nl->wait_frameno = 0, - nl->inppos = 0, + != 0 ) { + nl->wait_frameno = 0; + nl->inppos = 0; #ifdef CONFIG_SBNI_MULTILINE - nl->master->stats.rx_errors++, + nl->master->stats.rx_errors++; nl->master->stats.rx_missed_errors++; #else - dev->stats.rx_errors++, + dev->stats.rx_errors++; dev->stats.rx_missed_errors++; #endif + } /* now skip all frames until is_first != 0 */ } else frame_ok = skip_tail( dev->base_addr, framelen, crc ); - if( is_first && !frame_ok ) + if( is_first && !frame_ok ) { /* * Frame has been broken, but we had already stored * is_first... Drop entire packet. */ - nl->wait_frameno = 0, + nl->wait_frameno = 0; #ifdef CONFIG_SBNI_MULTILINE - nl->master->stats.rx_errors++, + nl->master->stats.rx_errors++; nl->master->stats.rx_crc_errors++; #else - dev->stats.rx_errors++, + dev->stats.rx_errors++; dev->stats.rx_crc_errors++; #endif + } return frame_ok; } @@ -782,17 +791,18 @@ interpret_ack( struct net_device *dev, unsigned ack ) if( nl->state & FL_WAIT_ACK ) { nl->outpos += nl->framelen; - if( --nl->tx_frameno ) + if( --nl->tx_frameno ) { nl->framelen = min_t(unsigned int, nl->maxframe, nl->tx_buf_p->len - nl->outpos); - else - send_complete( dev ), + } else { + send_complete( dev ); #ifdef CONFIG_SBNI_MULTILINE netif_wake_queue( nl->master ); #else netif_wake_queue( dev ); #endif + } } } @@ -872,16 +882,17 @@ drop_xmit_queue( struct net_device *dev ) { struct net_local *nl = netdev_priv(dev); - if( nl->tx_buf_p ) - dev_kfree_skb_any( nl->tx_buf_p ), - nl->tx_buf_p = NULL, + if( nl->tx_buf_p ) { + dev_kfree_skb_any( nl->tx_buf_p ); + nl->tx_buf_p = NULL; #ifdef CONFIG_SBNI_MULTILINE - nl->master->stats.tx_errors++, + nl->master->stats.tx_errors++; nl->master->stats.tx_carrier_errors++; #else - dev->stats.tx_errors++, + dev->stats.tx_errors++; dev->stats.tx_carrier_errors++; #endif + } nl->tx_frameno = 0; nl->framelen = 0; @@ -1327,12 +1338,13 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) spin_lock( &nl->lock ); flags = *(struct sbni_flags*) &ifr->ifr_ifru; - if( flags.fixed_rxl ) - nl->delta_rxl = 0, + if( flags.fixed_rxl ) { + nl->delta_rxl = 0; nl->cur_rxl_index = flags.rxl; - else - nl->delta_rxl = DEF_RXL_DELTA, + } else { + nl->delta_rxl = DEF_RXL_DELTA; nl->cur_rxl_index = DEF_RXL; + } nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ]; nl->csr1.rate = flags.rate; @@ -1526,13 +1538,16 @@ sbni_setup( char *p ) (*dest[ parm ])[ n ] = simple_strtol( p, &p, 0 ); if( !*p || *p == ')' ) return 1; - if( *p == ';' ) - ++p, ++n, parm = 0; - else if( *p++ != ',' ) + if( *p == ';' ) { + ++p; + ++n; + parm = 0; + } else if( *p++ != ',' ) { break; - else + } else { if( ++parm >= 5 ) break; + } } bad_param: pr_err("Error in sbni kernel parameter!\n"); -- cgit v1.2.3 From d32575aa628425b07afd763e3a70fcd897b4700a Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Sat, 29 Aug 2020 19:55:49 +0800 Subject: net: wan: slic_ds26522: Remove unused macro DRV_NAME There is no caller in tree any more. Signed-off-by: YueHaibing Signed-off-by: David S. Miller --- drivers/net/wan/slic_ds26522.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/slic_ds26522.c b/drivers/net/wan/slic_ds26522.c index 29053bec694e..8e3b1c717c10 100644 --- a/drivers/net/wan/slic_ds26522.c +++ b/drivers/net/wan/slic_ds26522.c @@ -22,8 +22,6 @@ #include #include "slic_ds26522.h" -#define DRV_NAME "ds26522" - #define SLIC_TRANS_LEN 1 #define SLIC_TWO_LEN 2 #define SLIC_THREE_LEN 3 -- cgit v1.2.3 From d60432994ea2ec559f60951260f381be9e460b64 Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Sat, 29 Aug 2020 19:58:23 +0800 Subject: net/wan/fsl_ucc_hdlc: Add MODULE_DESCRIPTION Add missing MODULE_DESCRIPTION. Signed-off-by: YueHaibing Signed-off-by: David S. Miller --- drivers/net/wan/fsl_ucc_hdlc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index 9edd94679283..dca97cd7c4e7 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -1295,3 +1295,4 @@ static struct platform_driver ucc_hdlc_driver = { module_platform_driver(ucc_hdlc_driver); MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION(DRV_DESC); -- cgit v1.2.3 From d324fa8021692c54bb9c527e374e1a3cb831cc81 Mon Sep 17 00:00:00 2001 From: Xie He Date: Thu, 10 Sep 2020 23:35:03 -0700 Subject: drivers/net/wan/x25_asy: Remove an unused flag "SLF_OUTWAIT" The "SLF_OUTWAIT" flag defined in x25_asy.h is not actually used. It is only cleared at one place in x25_asy.c but is never read or set. So we can remove it. Signed-off-by: Xie He Signed-off-by: David S. Miller --- drivers/net/wan/x25_asy.c | 2 -- drivers/net/wan/x25_asy.h | 1 - 2 files changed, 3 deletions(-) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 7ee980575208..5a7cf8bf9d0d 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c @@ -243,8 +243,6 @@ static void x25_asy_encaps(struct x25_asy *sl, unsigned char *icp, int len) actual = sl->tty->ops->write(sl->tty, sl->xbuff, count); sl->xleft = count - actual; sl->xhead = sl->xbuff + actual; - /* VSV */ - clear_bit(SLF_OUTWAIT, &sl->flags); /* reset outfill flag */ } /* diff --git a/drivers/net/wan/x25_asy.h b/drivers/net/wan/x25_asy.h index eb4a4216ee94..87798287c9ca 100644 --- a/drivers/net/wan/x25_asy.h +++ b/drivers/net/wan/x25_asy.h @@ -35,7 +35,6 @@ struct x25_asy { #define SLF_INUSE 0 /* Channel in use */ #define SLF_ESCAPE 1 /* ESC received */ #define SLF_ERROR 2 /* Parity, etc. error */ -#define SLF_OUTWAIT 4 /* Waiting for output */ }; -- cgit v1.2.3 From 4b4683853507128ed78e255aa0b1ef2b1bccba41 Mon Sep 17 00:00:00 2001 From: Xie He Date: Fri, 11 Sep 2020 19:18:07 -0700 Subject: drivers/net/wan/x25_asy: Remove an unnecessary x25_type_trans call x25_type_trans only needs to be called before we call netif_rx to pass the skb to upper layers. It does not need to be called before lapb_data_received. The LAPB module does not need the fields that are set by calling it. In the other two X.25 drivers - lapbether and hdlc_x25. x25_type_trans is only called before netif_rx and not before lapb_data_received. Cc: Martin Schiller Signed-off-by: Xie He Acked-by: Martin Schiller Signed-off-by: David S. Miller --- drivers/net/wan/x25_asy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 5a7cf8bf9d0d..ab56a5e6447a 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c @@ -202,8 +202,7 @@ static void x25_asy_bump(struct x25_asy *sl) return; } skb_put_data(skb, sl->rbuff, count); - skb->protocol = x25_type_trans(skb, sl->dev); - err = lapb_data_received(skb->dev, skb); + err = lapb_data_received(sl->dev, skb); if (err != LAPB_OK) { kfree_skb(skb); printk(KERN_DEBUG "x25_asy: data received err - %d\n", err); -- cgit v1.2.3 From c2f8c900792459cdd10e49f9c9ca15328223ad3b Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Tue, 29 Sep 2020 22:25:33 +0200 Subject: net: wan/lmc: Remove lmc_trace() lmc_trace() was first introduced in commit e7a392d5158af ("Import 2.3.99pre6-5") and was not touched ever since. The reason for looking at this was to get rid of the in_interrupt() usage, but while looking at it the following observations were made: - At least lmc_get_stats() (->ndo_get_stats()) is invoked with disabled preemption which is not detected by the in_interrupt() check, which would cause schedule() to be called from invalid context. - The code is hidden behind #ifdef LMC_TRACE which is not defined within the kernel and wasn't at the time it was introduced. - Three jiffies don't match 50ms. msleep() would be a better match which would also avoid the schedule() invocation. But why have it to begin with? - Nobody would do something like this today. Either netdev_dbg() or trace_printk() or a trace event would be used. If only the functions related to this driver are interesting then ftrace can be used with filtering. As it is obviously broken for years, simply remove it. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: David S. Miller --- drivers/net/wan/lmc/lmc_debug.c | 18 ------- drivers/net/wan/lmc/lmc_debug.h | 1 - drivers/net/wan/lmc/lmc_main.c | 105 +++------------------------------------- drivers/net/wan/lmc/lmc_media.c | 4 -- drivers/net/wan/lmc/lmc_proto.c | 16 ------ 5 files changed, 8 insertions(+), 136 deletions(-) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/lmc/lmc_debug.c b/drivers/net/wan/lmc/lmc_debug.c index f999db788506..2b6051bda3fb 100644 --- a/drivers/net/wan/lmc/lmc_debug.c +++ b/drivers/net/wan/lmc/lmc_debug.c @@ -62,22 +62,4 @@ void lmcEventLog(u32 EventNum, u32 arg2, u32 arg3) } #endif /* DEBUG */ -void lmc_trace(struct net_device *dev, char *msg){ -#ifdef LMC_TRACE - unsigned long j = jiffies + 3; /* Wait for 50 ms */ - - if(in_interrupt()){ - printk("%s: * %s\n", dev->name, msg); -// while(time_before(jiffies, j+10)) -// ; - } - else { - printk("%s: %s\n", dev->name, msg); - while(time_before(jiffies, j)) - schedule(); - } -#endif -} - - /* --------------------------- end if_lmc_linux.c ------------------------ */ diff --git a/drivers/net/wan/lmc/lmc_debug.h b/drivers/net/wan/lmc/lmc_debug.h index 820adcae5d67..cfae9eddf003 100644 --- a/drivers/net/wan/lmc/lmc_debug.h +++ b/drivers/net/wan/lmc/lmc_debug.h @@ -48,6 +48,5 @@ extern u32 lmcEventLogBuf[LMC_EVENTLOGSIZE * LMC_EVENTLOGARGS]; void lmcConsoleLog(char *type, unsigned char *ucData, int iLen); void lmcEventLog(u32 EventNum, u32 arg2, u32 arg3); -void lmc_trace(struct net_device *dev, char *msg); #endif diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c index 842def21e089..36600b0a0ab0 100644 --- a/drivers/net/wan/lmc/lmc_main.c +++ b/drivers/net/wan/lmc/lmc_main.c @@ -113,8 +113,6 @@ int lmc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/ u16 regVal; unsigned long flags; - lmc_trace(dev, "lmc_ioctl in"); - /* * Most functions mess with the structure * Disable interrupts while we do the polling @@ -619,8 +617,6 @@ int lmc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/ break; } - lmc_trace(dev, "lmc_ioctl out"); - return ret; } @@ -634,8 +630,6 @@ static void lmc_watchdog(struct timer_list *t) /*fold00*/ u32 ticks; unsigned long flags; - lmc_trace(dev, "lmc_watchdog in"); - spin_lock_irqsave(&sc->lmc_lock, flags); if(sc->check != 0xBEAFCAFE){ @@ -782,9 +776,6 @@ kick_timer: add_timer (&sc->timer); spin_unlock_irqrestore(&sc->lmc_lock, flags); - - lmc_trace(dev, "lmc_watchdog out"); - } static int lmc_attach(struct net_device *dev, unsigned short encoding, @@ -813,8 +804,6 @@ static int lmc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) int err; static int cards_found; - /* lmc_trace(dev, "lmc_init_one in"); */ - err = pcim_enable_device(pdev); if (err) { printk(KERN_ERR "lmc: pci enable failed: %d\n", err); @@ -955,7 +944,6 @@ static int lmc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) sc->lmc_ok = 0; sc->last_link_status = 0; - lmc_trace(dev, "lmc_init_one out"); return 0; } @@ -981,8 +969,6 @@ static int lmc_open(struct net_device *dev) lmc_softc_t *sc = dev_to_sc(dev); int err; - lmc_trace(dev, "lmc_open in"); - lmc_led_on(sc, LMC_DS3_LED0); lmc_dec_reset(sc); @@ -992,17 +978,14 @@ static int lmc_open(struct net_device *dev) LMC_EVENT_LOG(LMC_EVENT_RESET2, lmc_mii_readreg(sc, 0, 16), lmc_mii_readreg(sc, 0, 17)); - if (sc->lmc_ok){ - lmc_trace(dev, "lmc_open lmc_ok out"); + if (sc->lmc_ok) return 0; - } lmc_softreset (sc); /* Since we have to use PCI bus, this should work on x86,alpha,ppc */ if (request_irq (dev->irq, lmc_interrupt, IRQF_SHARED, dev->name, dev)){ printk(KERN_WARNING "%s: could not get irq: %d\n", dev->name, dev->irq); - lmc_trace(dev, "lmc_open irq failed out"); return -EAGAIN; } sc->got_irq = 1; @@ -1078,8 +1061,6 @@ static int lmc_open(struct net_device *dev) sc->timer.expires = jiffies + HZ; add_timer (&sc->timer); - lmc_trace(dev, "lmc_open out"); - return 0; } @@ -1091,8 +1072,6 @@ static void lmc_running_reset (struct net_device *dev) /*fold00*/ { lmc_softc_t *sc = dev_to_sc(dev); - lmc_trace(dev, "lmc_running_reset in"); - /* stop interrupts */ /* Clear the interrupt mask */ LMC_CSR_WRITE (sc, csr_intr, 0x00000000); @@ -1114,8 +1093,6 @@ static void lmc_running_reset (struct net_device *dev) /*fold00*/ sc->lmc_cmdmode |= (TULIP_CMD_TXRUN | TULIP_CMD_RXRUN); LMC_CSR_WRITE (sc, csr_command, sc->lmc_cmdmode); - - lmc_trace(dev, "lmc_running_reset_out"); } @@ -1128,16 +1105,12 @@ static int lmc_close(struct net_device *dev) /* not calling release_region() as we should */ lmc_softc_t *sc = dev_to_sc(dev); - lmc_trace(dev, "lmc_close in"); - sc->lmc_ok = 0; sc->lmc_media->set_link_status (sc, 0); del_timer (&sc->timer); lmc_proto_close(sc); lmc_ifdown (dev); - lmc_trace(dev, "lmc_close out"); - return 0; } @@ -1149,8 +1122,6 @@ static int lmc_ifdown (struct net_device *dev) /*fold00*/ u32 csr6; int i; - lmc_trace(dev, "lmc_ifdown in"); - /* Don't let anything else go on right now */ // dev->start = 0; netif_stop_queue(dev); @@ -1200,8 +1171,6 @@ static int lmc_ifdown (struct net_device *dev) /*fold00*/ netif_wake_queue(dev); sc->extra_stats.tx_tbusy0++; - lmc_trace(dev, "lmc_ifdown out"); - return 0; } @@ -1220,8 +1189,6 @@ static irqreturn_t lmc_interrupt (int irq, void *dev_instance) /*fold00*/ int max_work = LMC_RXDESCS; int handled = 0; - lmc_trace(dev, "lmc_interrupt in"); - spin_lock(&sc->lmc_lock); /* @@ -1264,12 +1231,10 @@ static irqreturn_t lmc_interrupt (int irq, void *dev_instance) /*fold00*/ lmc_running_reset (dev); break; } - - if (csr & TULIP_STS_RXINTR){ - lmc_trace(dev, "rx interrupt"); + + if (csr & TULIP_STS_RXINTR) lmc_rx (dev); - - } + if (csr & (TULIP_STS_TXINTR | TULIP_STS_TXNOBUF | TULIP_STS_TXSTOPPED)) { int n_compl = 0 ; @@ -1389,7 +1354,6 @@ lmc_int_fail_out: spin_unlock(&sc->lmc_lock); - lmc_trace(dev, "lmc_interrupt out"); return IRQ_RETVAL(handled); } @@ -1401,8 +1365,6 @@ static netdev_tx_t lmc_start_xmit(struct sk_buff *skb, int entry; unsigned long flags; - lmc_trace(dev, "lmc_start_xmit in"); - spin_lock_irqsave(&sc->lmc_lock, flags); /* normal path, tbusy known to be zero */ @@ -1477,7 +1439,6 @@ static netdev_tx_t lmc_start_xmit(struct sk_buff *skb, spin_unlock_irqrestore(&sc->lmc_lock, flags); - lmc_trace(dev, "lmc_start_xmit_out"); return NETDEV_TX_OK; } @@ -1493,8 +1454,6 @@ static int lmc_rx(struct net_device *dev) struct sk_buff *skb, *nsb; u16 len; - lmc_trace(dev, "lmc_rx in"); - lmc_led_on(sc, LMC_DS3_LED3); rxIntLoopCnt = 0; /* debug -baz */ @@ -1673,9 +1632,6 @@ static int lmc_rx(struct net_device *dev) lmc_led_off(sc, LMC_DS3_LED3); skip_out_of_mem: - - lmc_trace(dev, "lmc_rx out"); - return 0; } @@ -1684,16 +1640,12 @@ static struct net_device_stats *lmc_get_stats(struct net_device *dev) lmc_softc_t *sc = dev_to_sc(dev); unsigned long flags; - lmc_trace(dev, "lmc_get_stats in"); - spin_lock_irqsave(&sc->lmc_lock, flags); sc->lmc_device->stats.rx_missed_errors += LMC_CSR_READ(sc, csr_missed_frames) & 0xffff; spin_unlock_irqrestore(&sc->lmc_lock, flags); - lmc_trace(dev, "lmc_get_stats out"); - return &sc->lmc_device->stats; } @@ -1712,12 +1664,8 @@ unsigned lmc_mii_readreg (lmc_softc_t * const sc, unsigned devaddr, unsigned reg int command = (0xf6 << 10) | (devaddr << 5) | regno; int retval = 0; - lmc_trace(sc->lmc_device, "lmc_mii_readreg in"); - LMC_MII_SYNC (sc); - lmc_trace(sc->lmc_device, "lmc_mii_readreg: done sync"); - for (i = 15; i >= 0; i--) { int dataval = (command & (1 << i)) ? 0x20000 : 0; @@ -1730,8 +1678,6 @@ unsigned lmc_mii_readreg (lmc_softc_t * const sc, unsigned devaddr, unsigned reg /* __SLOW_DOWN_IO; */ } - lmc_trace(sc->lmc_device, "lmc_mii_readreg: done1"); - for (i = 19; i > 0; i--) { LMC_CSR_WRITE (sc, csr_9, 0x40000); @@ -1743,8 +1689,6 @@ unsigned lmc_mii_readreg (lmc_softc_t * const sc, unsigned devaddr, unsigned reg /* __SLOW_DOWN_IO; */ } - lmc_trace(sc->lmc_device, "lmc_mii_readreg out"); - return (retval >> 1) & 0xffff; } @@ -1753,8 +1697,6 @@ void lmc_mii_writereg (lmc_softc_t * const sc, unsigned devaddr, unsigned regno, int i = 32; int command = (0x5002 << 16) | (devaddr << 23) | (regno << 18) | data; - lmc_trace(sc->lmc_device, "lmc_mii_writereg in"); - LMC_MII_SYNC (sc); i = 31; @@ -1787,16 +1729,12 @@ void lmc_mii_writereg (lmc_softc_t * const sc, unsigned devaddr, unsigned regno, /* __SLOW_DOWN_IO; */ i--; } - - lmc_trace(sc->lmc_device, "lmc_mii_writereg out"); } static void lmc_softreset (lmc_softc_t * const sc) /*fold00*/ { int i; - lmc_trace(sc->lmc_device, "lmc_softreset in"); - /* Initialize the receive rings and buffers. */ sc->lmc_txfull = 0; sc->lmc_next_rx = 0; @@ -1871,55 +1809,40 @@ static void lmc_softreset (lmc_softc_t * const sc) /*fold00*/ } sc->lmc_txring[i - 1].buffer2 = virt_to_bus (&sc->lmc_txring[0]); LMC_CSR_WRITE (sc, csr_txlist, virt_to_bus (sc->lmc_txring)); - - lmc_trace(sc->lmc_device, "lmc_softreset out"); } void lmc_gpio_mkinput(lmc_softc_t * const sc, u32 bits) /*fold00*/ { - lmc_trace(sc->lmc_device, "lmc_gpio_mkinput in"); sc->lmc_gpio_io &= ~bits; LMC_CSR_WRITE(sc, csr_gp, TULIP_GP_PINSET | (sc->lmc_gpio_io)); - lmc_trace(sc->lmc_device, "lmc_gpio_mkinput out"); } void lmc_gpio_mkoutput(lmc_softc_t * const sc, u32 bits) /*fold00*/ { - lmc_trace(sc->lmc_device, "lmc_gpio_mkoutput in"); sc->lmc_gpio_io |= bits; LMC_CSR_WRITE(sc, csr_gp, TULIP_GP_PINSET | (sc->lmc_gpio_io)); - lmc_trace(sc->lmc_device, "lmc_gpio_mkoutput out"); } void lmc_led_on(lmc_softc_t * const sc, u32 led) /*fold00*/ { - lmc_trace(sc->lmc_device, "lmc_led_on in"); - if((~sc->lmc_miireg16) & led){ /* Already on! */ - lmc_trace(sc->lmc_device, "lmc_led_on aon out"); + if ((~sc->lmc_miireg16) & led) /* Already on! */ return; - } - + sc->lmc_miireg16 &= ~led; lmc_mii_writereg(sc, 0, 16, sc->lmc_miireg16); - lmc_trace(sc->lmc_device, "lmc_led_on out"); } void lmc_led_off(lmc_softc_t * const sc, u32 led) /*fold00*/ { - lmc_trace(sc->lmc_device, "lmc_led_off in"); - if(sc->lmc_miireg16 & led){ /* Already set don't do anything */ - lmc_trace(sc->lmc_device, "lmc_led_off aoff out"); + if (sc->lmc_miireg16 & led) /* Already set don't do anything */ return; - } - + sc->lmc_miireg16 |= led; lmc_mii_writereg(sc, 0, 16, sc->lmc_miireg16); - lmc_trace(sc->lmc_device, "lmc_led_off out"); } static void lmc_reset(lmc_softc_t * const sc) /*fold00*/ { - lmc_trace(sc->lmc_device, "lmc_reset in"); sc->lmc_miireg16 |= LMC_MII16_FIFO_RESET; lmc_mii_writereg(sc, 0, 16, sc->lmc_miireg16); @@ -1955,13 +1878,11 @@ static void lmc_reset(lmc_softc_t * const sc) /*fold00*/ sc->lmc_media->init(sc); sc->extra_stats.resetCount++; - lmc_trace(sc->lmc_device, "lmc_reset out"); } static void lmc_dec_reset(lmc_softc_t * const sc) /*fold00*/ { u32 val; - lmc_trace(sc->lmc_device, "lmc_dec_reset in"); /* * disable all interrupts @@ -2017,14 +1938,11 @@ static void lmc_dec_reset(lmc_softc_t * const sc) /*fold00*/ val = LMC_CSR_READ(sc, csr_sia_general); val |= (TULIP_WATCHDOG_TXDISABLE | TULIP_WATCHDOG_RXDISABLE); LMC_CSR_WRITE(sc, csr_sia_general, val); - - lmc_trace(sc->lmc_device, "lmc_dec_reset out"); } static void lmc_initcsrs(lmc_softc_t * const sc, lmc_csrptr_t csr_base, /*fold00*/ size_t csr_size) { - lmc_trace(sc->lmc_device, "lmc_initcsrs in"); sc->lmc_csrs.csr_busmode = csr_base + 0 * csr_size; sc->lmc_csrs.csr_txpoll = csr_base + 1 * csr_size; sc->lmc_csrs.csr_rxpoll = csr_base + 2 * csr_size; @@ -2041,7 +1959,6 @@ static void lmc_initcsrs(lmc_softc_t * const sc, lmc_csrptr_t csr_base, /*fold00 sc->lmc_csrs.csr_13 = csr_base + 13 * csr_size; sc->lmc_csrs.csr_14 = csr_base + 14 * csr_size; sc->lmc_csrs.csr_15 = csr_base + 15 * csr_size; - lmc_trace(sc->lmc_device, "lmc_initcsrs out"); } static void lmc_driver_timeout(struct net_device *dev, unsigned int txqueue) @@ -2050,8 +1967,6 @@ static void lmc_driver_timeout(struct net_device *dev, unsigned int txqueue) u32 csr6; unsigned long flags; - lmc_trace(dev, "lmc_driver_timeout in"); - spin_lock_irqsave(&sc->lmc_lock, flags); printk("%s: Xmitter busy|\n", dev->name); @@ -2094,8 +2009,4 @@ static void lmc_driver_timeout(struct net_device *dev, unsigned int txqueue) bug_out: spin_unlock_irqrestore(&sc->lmc_lock, flags); - - lmc_trace(dev, "lmc_driver_timeout out"); - - } diff --git a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c index 23ca4a62d6f5..ec1ac7b1f3fd 100644 --- a/drivers/net/wan/lmc/lmc_media.c +++ b/drivers/net/wan/lmc/lmc_media.c @@ -1026,7 +1026,6 @@ lmc_t1_get_link_status (lmc_softc_t * const sc) * led3 red = Loss of Signal (LOS) or out of frame (OOF) * conditions detected on T3 receive signal */ - lmc_trace(sc->lmc_device, "lmc_t1_get_link_status in"); lmc_led_on(sc, LMC_DS3_LED2); lmc_mii_writereg (sc, 0, 17, T1FRAMER_ALARM1_STATUS); @@ -1120,9 +1119,6 @@ lmc_t1_get_link_status (lmc_softc_t * const sc) lmc_mii_writereg (sc, 0, 17, T1FRAMER_ALARM2_STATUS); sc->lmc_xinfo.t1_alarm2_status = lmc_mii_readreg (sc, 0, 18); - - lmc_trace(sc->lmc_device, "lmc_t1_get_link_status out"); - return ret; } diff --git a/drivers/net/wan/lmc/lmc_proto.c b/drivers/net/wan/lmc/lmc_proto.c index a58301dd0c1f..e8b0b902b424 100644 --- a/drivers/net/wan/lmc/lmc_proto.c +++ b/drivers/net/wan/lmc/lmc_proto.c @@ -47,7 +47,6 @@ // attach void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/ { - lmc_trace(sc->lmc_device, "lmc_proto_attach in"); if (sc->if_type == LMC_NET) { struct net_device *dev = sc->lmc_device; /* @@ -57,12 +56,10 @@ void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/ dev->hard_header_len = 0; dev->addr_len = 0; } - lmc_trace(sc->lmc_device, "lmc_proto_attach out"); } int lmc_proto_ioctl(lmc_softc_t *sc, struct ifreq *ifr, int cmd) { - lmc_trace(sc->lmc_device, "lmc_proto_ioctl"); if (sc->if_type == LMC_PPP) return hdlc_ioctl(sc->lmc_device, ifr, cmd); return -EOPNOTSUPP; @@ -72,32 +69,23 @@ int lmc_proto_open(lmc_softc_t *sc) { int ret = 0; - lmc_trace(sc->lmc_device, "lmc_proto_open in"); - if (sc->if_type == LMC_PPP) { ret = hdlc_open(sc->lmc_device); if (ret < 0) printk(KERN_WARNING "%s: HDLC open failed: %d\n", sc->name, ret); } - - lmc_trace(sc->lmc_device, "lmc_proto_open out"); return ret; } void lmc_proto_close(lmc_softc_t *sc) { - lmc_trace(sc->lmc_device, "lmc_proto_close in"); - if (sc->if_type == LMC_PPP) hdlc_close(sc->lmc_device); - - lmc_trace(sc->lmc_device, "lmc_proto_close out"); } __be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/ { - lmc_trace(sc->lmc_device, "lmc_proto_type in"); switch(sc->if_type){ case LMC_PPP: return hdlc_type_trans(skb, sc->lmc_device); @@ -113,13 +101,10 @@ __be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/ return htons(ETH_P_802_2); break; } - lmc_trace(sc->lmc_device, "lmc_proto_tye out"); - } void lmc_proto_netif(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/ { - lmc_trace(sc->lmc_device, "lmc_proto_netif in"); switch(sc->if_type){ case LMC_PPP: case LMC_NET: @@ -129,5 +114,4 @@ void lmc_proto_netif(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/ case LMC_RAW: break; } - lmc_trace(sc->lmc_device, "lmc_proto_netif out"); } -- cgit v1.2.3 From 8306266c1d51aac9aa7aa907fe99032a58c6382c Mon Sep 17 00:00:00 2001 From: Xie He Date: Mon, 28 Sep 2020 05:56:43 -0700 Subject: drivers/net/wan/hdlc_fr: Correctly handle special skb->protocol values The fr_hard_header function is used to prepend the header to skbs before transmission. It is used in 3 situations: 1) When a control packet is generated internally in this driver; 2) When a user sends an skb on an Ethernet-emulating PVC device; 3) When a user sends an skb on a normal PVC device. These 3 situations need to be handled differently by fr_hard_header. Different headers should be prepended to the skb in different situations. Currently fr_hard_header distinguishes these 3 situations using skb->protocol. For situation 1 and 2, a special skb->protocol value will be assigned before calling fr_hard_header, so that it can recognize these 2 situations. All skb->protocol values other than these special ones are treated by fr_hard_header as situation 3. However, it is possible that in situation 3, the user sends an skb with one of the special skb->protocol values. In this case, fr_hard_header would incorrectly treat it as situation 1 or 2. This patch tries to solve this issue by using skb->dev instead of skb->protocol to distinguish between these 3 situations. For situation 1, skb->dev would be NULL; for situation 2, skb->dev->type would be ARPHRD_ETHER; and for situation 3, skb->dev->type would be ARPHRD_DLCI. This way fr_hard_header would be able to distinguish these 3 situations correctly regardless what skb->protocol value the user tries to use in situation 3. Cc: Krzysztof Halasa Signed-off-by: Xie He Signed-off-by: David S. Miller --- drivers/net/wan/hdlc_fr.c | 98 ++++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 47 deletions(-) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index d6cfd51613ed..3a44dad87602 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c @@ -273,63 +273,69 @@ static inline struct net_device **get_dev_p(struct pvc_device *pvc, static int fr_hard_header(struct sk_buff **skb_p, u16 dlci) { - u16 head_len; struct sk_buff *skb = *skb_p; - switch (skb->protocol) { - case cpu_to_be16(NLPID_CCITT_ANSI_LMI): - head_len = 4; - skb_push(skb, head_len); - skb->data[3] = NLPID_CCITT_ANSI_LMI; - break; - - case cpu_to_be16(NLPID_CISCO_LMI): - head_len = 4; - skb_push(skb, head_len); - skb->data[3] = NLPID_CISCO_LMI; - break; - - case cpu_to_be16(ETH_P_IP): - head_len = 4; - skb_push(skb, head_len); - skb->data[3] = NLPID_IP; - break; - - case cpu_to_be16(ETH_P_IPV6): - head_len = 4; - skb_push(skb, head_len); - skb->data[3] = NLPID_IPV6; - break; - - case cpu_to_be16(ETH_P_802_3): - head_len = 10; - if (skb_headroom(skb) < head_len) { - struct sk_buff *skb2 = skb_realloc_headroom(skb, - head_len); + if (!skb->dev) { /* Control packets */ + switch (dlci) { + case LMI_CCITT_ANSI_DLCI: + skb_push(skb, 4); + skb->data[3] = NLPID_CCITT_ANSI_LMI; + break; + + case LMI_CISCO_DLCI: + skb_push(skb, 4); + skb->data[3] = NLPID_CISCO_LMI; + break; + + default: + return -EINVAL; + } + + } else if (skb->dev->type == ARPHRD_DLCI) { + switch (skb->protocol) { + case htons(ETH_P_IP): + skb_push(skb, 4); + skb->data[3] = NLPID_IP; + break; + + case htons(ETH_P_IPV6): + skb_push(skb, 4); + skb->data[3] = NLPID_IPV6; + break; + + default: + skb_push(skb, 10); + skb->data[3] = FR_PAD; + skb->data[4] = NLPID_SNAP; + /* OUI 00-00-00 indicates an Ethertype follows */ + skb->data[5] = 0x00; + skb->data[6] = 0x00; + skb->data[7] = 0x00; + /* This should be an Ethertype: */ + *(__be16 *)(skb->data + 8) = skb->protocol; + } + + } else if (skb->dev->type == ARPHRD_ETHER) { + if (skb_headroom(skb) < 10) { + struct sk_buff *skb2 = skb_realloc_headroom(skb, 10); if (!skb2) return -ENOBUFS; dev_kfree_skb(skb); skb = *skb_p = skb2; } - skb_push(skb, head_len); + skb_push(skb, 10); skb->data[3] = FR_PAD; skb->data[4] = NLPID_SNAP; - skb->data[5] = FR_PAD; + /* OUI 00-80-C2 stands for the 802.1 organization */ + skb->data[5] = 0x00; skb->data[6] = 0x80; skb->data[7] = 0xC2; + /* PID 00-07 stands for Ethernet frames without FCS */ skb->data[8] = 0x00; - skb->data[9] = 0x07; /* bridged Ethernet frame w/out FCS */ - break; + skb->data[9] = 0x07; - default: - head_len = 10; - skb_push(skb, head_len); - skb->data[3] = FR_PAD; - skb->data[4] = NLPID_SNAP; - skb->data[5] = FR_PAD; - skb->data[6] = FR_PAD; - skb->data[7] = FR_PAD; - *(__be16*)(skb->data + 8) = skb->protocol; + } else { + return -EINVAL; } dlci_to_q922(skb->data, dlci); @@ -425,8 +431,8 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev) skb_put(skb, pad); memset(skb->data + len, 0, pad); } - skb->protocol = cpu_to_be16(ETH_P_802_3); } + skb->dev = dev; if (!fr_hard_header(&skb, pvc->dlci)) { dev->stats.tx_bytes += skb->len; dev->stats.tx_packets++; @@ -494,10 +500,8 @@ static void fr_lmi_send(struct net_device *dev, int fullrep) memset(skb->data, 0, len); skb_reserve(skb, 4); if (lmi == LMI_CISCO) { - skb->protocol = cpu_to_be16(NLPID_CISCO_LMI); fr_hard_header(&skb, LMI_CISCO_DLCI); } else { - skb->protocol = cpu_to_be16(NLPID_CCITT_ANSI_LMI); fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI); } data = skb_tail_pointer(skb); -- cgit v1.2.3 From f5083d0cee08a4b87d5d7a5c57f60ec128bff997 Mon Sep 17 00:00:00 2001 From: Xie He Date: Sat, 3 Oct 2020 15:41:05 -0700 Subject: drivers/net/wan/hdlc_fr: Improvements to the code of pvc_xmit 1. Keep the code for the normal (non-error) flow at the lowest indentation level. And use "goto drop" for all error handling. 2. Replace code that pads short Ethernet frames with a "__skb_pad" call. 3. Change "dev_kfree_skb" to "kfree_skb" in error handling code. "kfree_skb" is the correct function to call when dropping an skb due to an error. "dev_kfree_skb", which is an alias of "consume_skb", is for dropping skbs normally (not due to an error). Cc: Krzysztof Halasa Cc: Stephen Hemminger Signed-off-by: Xie He Signed-off-by: David S. Miller --- drivers/net/wan/hdlc_fr.c | 54 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 3a44dad87602..4dfdbca54296 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c @@ -416,38 +416,36 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev) { struct pvc_device *pvc = dev->ml_priv; - if (pvc->state.active) { - if (dev->type == ARPHRD_ETHER) { - int pad = ETH_ZLEN - skb->len; - if (pad > 0) { /* Pad the frame with zeros */ - int len = skb->len; - if (skb_tailroom(skb) < pad) - if (pskb_expand_head(skb, 0, pad, - GFP_ATOMIC)) { - dev->stats.tx_dropped++; - dev_kfree_skb(skb); - return NETDEV_TX_OK; - } - skb_put(skb, pad); - memset(skb->data + len, 0, pad); - } - } - skb->dev = dev; - if (!fr_hard_header(&skb, pvc->dlci)) { - dev->stats.tx_bytes += skb->len; - dev->stats.tx_packets++; - if (pvc->state.fecn) /* TX Congestion counter */ - dev->stats.tx_compressed++; - skb->dev = pvc->frad; - skb->protocol = htons(ETH_P_HDLC); - skb_reset_network_header(skb); - dev_queue_xmit(skb); - return NETDEV_TX_OK; + if (!pvc->state.active) + goto drop; + + if (dev->type == ARPHRD_ETHER) { + int pad = ETH_ZLEN - skb->len; + + if (pad > 0) { /* Pad the frame with zeros */ + if (__skb_pad(skb, pad, false)) + goto drop; + skb_put(skb, pad); } } + skb->dev = dev; + if (fr_hard_header(&skb, pvc->dlci)) + goto drop; + + dev->stats.tx_bytes += skb->len; + dev->stats.tx_packets++; + if (pvc->state.fecn) /* TX Congestion counter */ + dev->stats.tx_compressed++; + skb->dev = pvc->frad; + skb->protocol = htons(ETH_P_HDLC); + skb_reset_network_header(skb); + dev_queue_xmit(skb); + return NETDEV_TX_OK; + +drop: dev->stats.tx_dropped++; - dev_kfree_skb(skb); + kfree_skb(skb); return NETDEV_TX_OK; } -- cgit v1.2.3 From df41c19abbeaae6e24c8e31cff5fdb48632be380 Mon Sep 17 00:00:00 2001 From: Xie He Date: Wed, 7 Oct 2020 11:32:03 -0700 Subject: drivers/net/wan/hdlc_fr: Move the skb_headroom check out of fr_hard_header Move the skb_headroom check out of fr_hard_header and into pvc_xmit. This has two benefits: 1. Originally we only do this check for skbs sent by users on Ethernet- emulating PVC devices. After the change we do this check for skbs sent on normal PVC devices, too. (Also add a comment to make it clear that this is only a protection against upper layers that don't take dev->needed_headroom into account. Such upper layers should be rare and I believe they should be fixed.) 2. After the change we can simplify the parameter list of fr_hard_header. We no longer need to use a pointer to pointers (skb_p) because we no longer need to replace the skb inside fr_hard_header. Cc: Krzysztof Halasa Signed-off-by: Xie He Signed-off-by: Jakub Kicinski --- drivers/net/wan/hdlc_fr.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'drivers/net/wan') diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 4dfdbca54296..409e5a7ad8e2 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c @@ -271,10 +271,8 @@ static inline struct net_device **get_dev_p(struct pvc_device *pvc, } -static int fr_hard_header(struct sk_buff **skb_p, u16 dlci) +static int fr_hard_header(struct sk_buff *skb, u16 dlci) { - struct sk_buff *skb = *skb_p; - if (!skb->dev) { /* Control packets */ switch (dlci) { case LMI_CCITT_ANSI_DLCI: @@ -316,13 +314,6 @@ static int fr_hard_header(struct sk_buff **skb_p, u16 dlci) } } else if (skb->dev->type == ARPHRD_ETHER) { - if (skb_headroom(skb) < 10) { - struct sk_buff *skb2 = skb_realloc_headroom(skb, 10); - if (!skb2) - return -ENOBUFS; - dev_kfree_skb(skb); - skb = *skb_p = skb2; - } skb_push(skb, 10); skb->data[3] = FR_PAD; skb->data[4] = NLPID_SNAP; @@ -429,8 +420,21 @@ static netdev_tx_t pvc_xmit(struct sk_buff *skb, struct net_device *dev) } } + /* We already requested the header space with dev->needed_headroom. + * So this is just a protection in case the upper layer didn't take + * dev->needed_headroom into consideration. + */ + if (skb_headroom(skb) < 10) { + struct sk_buff *skb2 = skb_realloc_headroom(skb, 10); + + if (!skb2) + goto drop; + dev_kfree_skb(skb); + skb = skb2; + } + skb->dev = dev; - if (fr_hard_header(&skb, pvc->dlci)) + if (fr_hard_header(skb, pvc->dlci)) goto drop; dev->stats.tx_bytes += skb->len; @@ -498,9 +502,9 @@ static void fr_lmi_send(struct net_device *dev, int fullrep) memset(skb->data, 0, len); skb_reserve(skb, 4); if (lmi == LMI_CISCO) { - fr_hard_header(&skb, LMI_CISCO_DLCI); + fr_hard_header(skb, LMI_CISCO_DLCI); } else { - fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI); + fr_hard_header(skb, LMI_CCITT_ANSI_DLCI); } data = skb_tail_pointer(skb); data[i++] = LMI_CALLREF; -- cgit v1.2.3