···13521352 * or wireless extensions13531353 */1354135413551355-/*------------------------------------------------------------------*/13561356-/*13571357- * Get the current ethernet statistics. This may be called with the13581358- * card open or closed.13591359- * Used when the user read /proc/net/dev13601360- */13611361-static en_stats *13621362-wavelan_get_stats(struct net_device * dev)13631363-{13641364-#ifdef DEBUG_IOCTL_TRACE13651365- printk(KERN_DEBUG "%s: <>wavelan_get_stats()\n", dev->name);13661366-#endif13671367-13681368- return(&((net_local *)netdev_priv(dev))->stats);13691369-}1370135513711356/*------------------------------------------------------------------*/13721357/*···28022817 printk(KERN_INFO "%s: wv_packet_read(): could not alloc_skb(%d, GFP_ATOMIC)\n",28032818 dev->name, sksize);28042819#endif28052805- lp->stats.rx_dropped++;28202820+ dev->stats.rx_dropped++;28062821 /*28072822 * Not only do we want to return here, but we also need to drop the28082823 * packet on the floor to clear the interrupt.···28622877 netif_rx(skb);2863287828642879 /* Keep stats up to date */28652865- lp->stats.rx_packets++;28662866- lp->stats.rx_bytes += sksize;28802880+ dev->stats.rx_packets++;28812881+ dev->stats.rx_bytes += sksize;2867288228682883#ifdef DEBUG_RX_TRACE28692884 printk(KERN_DEBUG "%s: <-wv_packet_read()\n", dev->name);···29652980 /* Check status */29662981 if((status & RX_RCV_OK) != RX_RCV_OK)29672982 {29682968- lp->stats.rx_errors++;29832983+ dev->stats.rx_errors++;29692984 if(status & RX_NO_SFD)29702970- lp->stats.rx_frame_errors++;29852985+ dev->stats.rx_frame_errors++;29712986 if(status & RX_CRC_ERR)29722972- lp->stats.rx_crc_errors++;29872987+ dev->stats.rx_crc_errors++;29732988 if(status & RX_OVRRUN)29742974- lp->stats.rx_over_errors++;29892989+ dev->stats.rx_over_errors++;2975299029762991#ifdef DEBUG_RX_FAIL29772992 printk(KERN_DEBUG "%s: wv_packet_rcv(): packet not received ok, status = 0x%x\n",···30583073 dev->trans_start = jiffies;3059307430603075 /* Keep stats up to date */30613061- lp->stats.tx_bytes += length;30763076+ dev->stats.tx_bytes += length;3062307730633078 spin_unlock_irqrestore(&lp->spinlock, flags);30643079···40914106 printk(KERN_INFO "%s: wv_interrupt(): receive buffer overflow\n",40924107 dev->name);40934108#endif40944094- lp->stats.rx_over_errors++;41094109+ dev->stats.rx_over_errors++;40954110 lp->overrunning = 1;40964111 }40974112···41404155 /* Check for possible errors */41414156 if((tx_status & TX_OK) != TX_OK)41424157 {41434143- lp->stats.tx_errors++;41584158+ dev->stats.tx_errors++;4144415941454160 if(tx_status & TX_FRTL)41464161 {···41554170 printk(KERN_DEBUG "%s: wv_interrupt(): DMA underrun\n",41564171 dev->name);41574172#endif41584158- lp->stats.tx_aborted_errors++;41734173+ dev->stats.tx_aborted_errors++;41594174 }41604175 if(tx_status & TX_LOST_CTS)41614176 {41624177#ifdef DEBUG_TX_FAIL41634178 printk(KERN_DEBUG "%s: wv_interrupt(): no CTS\n", dev->name);41644179#endif41654165- lp->stats.tx_carrier_errors++;41804180+ dev->stats.tx_carrier_errors++;41664181 }41674182 if(tx_status & TX_LOST_CRS)41684183 {···41704185 printk(KERN_DEBUG "%s: wv_interrupt(): no carrier\n",41714186 dev->name);41724187#endif41734173- lp->stats.tx_carrier_errors++;41884188+ dev->stats.tx_carrier_errors++;41744189 }41754190 if(tx_status & TX_HRT_BEAT)41764191 {41774192#ifdef DEBUG_TX_FAIL41784193 printk(KERN_DEBUG "%s: wv_interrupt(): heart beat\n", dev->name);41794194#endif41804180- lp->stats.tx_heartbeat_errors++;41954195+ dev->stats.tx_heartbeat_errors++;41814196 }41824197 if(tx_status & TX_DEFER)41834198 {···42014216#endif42024217 if(!(tx_status & TX_NCOL_MASK))42034218 {42044204- lp->stats.collisions += 0x10;42194219+ dev->stats.collisions += 0x10;42054220 }42064221 }42074222 }42084223 } /* if(!(tx_status & TX_OK)) */4209422442104210- lp->stats.collisions += (tx_status & TX_NCOL_MASK);42114211- lp->stats.tx_packets++;42254225+ dev->stats.collisions += (tx_status & TX_NCOL_MASK);42264226+ dev->stats.tx_packets++;4212422742134228 netif_wake_queue(dev);42144229 outb(CR0_INT_ACK | OP0_NOP, LCCR(base)); /* Acknowledge the interrupt */···44994514 dev->open = &wavelan_open;45004515 dev->stop = &wavelan_close;45014516 dev->hard_start_xmit = &wavelan_packet_xmit;45024502- dev->get_stats = &wavelan_get_stats;45034517 dev->set_multicast_list = &wavelan_set_multicast_list;45044518#ifdef SET_MAC_ADDRESS45054519 dev->set_mac_address = &wavelan_set_mac_address;
-6
drivers/net/wireless/wavelan_cs.p.h
···576576/****************************** TYPES ******************************/577577578578/* Shortcuts */579579-typedef struct net_device_stats en_stats;580579typedef struct iw_statistics iw_stats;581580typedef struct iw_quality iw_qual;582581typedef struct iw_freq iw_freq;···591592 * For each network interface, Linux keep data in two structure. "device"592593 * keep the generic data (same format for everybody) and "net_local" keep593594 * the additional specific data.594594- * Note that some of this specific data is in fact generic (en_stats, for595595- * example).596595 */597596struct net_local598597{···598601 struct net_device * dev; /* Reverse link... */599602 spinlock_t spinlock; /* Serialize access to the hardware (SMP) */600603 struct pcmcia_device * link; /* pcmcia structure */601601- en_stats stats; /* Ethernet interface statistics */602604 int nresets; /* Number of hw resets */603605 u_char configured; /* If it is configured */604606 u_char reconfig_82593; /* Need to reconfigure the controller */···690694static void691695 wv_init_info(struct net_device *); /* display startup info */692696/* ------------------- IOCTL, STATS & RECONFIG ------------------- */693693-static en_stats *694694- wavelan_get_stats(struct net_device *); /* Give stats /proc/net/dev */695697static iw_stats *696698 wavelan_get_wireless_stats(struct net_device *);697699/* ----------------------- PACKET RECEPTION ----------------------- */