b43: LP-PHY: Two small spec updates
[pandora-kernel.git] / drivers / net / wireless / strip.c
index b7b0c46..ef2cb20 100644 (file)
@@ -1540,7 +1540,7 @@ static int strip_xmit(struct sk_buff *skb, struct net_device *dev)
        if (!netif_running(dev)) {
                printk(KERN_ERR "%s: xmit call when iface is down\n",
                       dev->name);
-               return (1);
+               return NETDEV_TX_BUSY;
        }
 
        netif_stop_queue(dev);
@@ -1550,9 +1550,12 @@ static int strip_xmit(struct sk_buff *skb, struct net_device *dev)
 
        if (time_after(jiffies, strip_info->pps_timer + HZ)) {
                unsigned long t = jiffies - strip_info->pps_timer;
-               unsigned long rx_pps_count = (strip_info->rx_pps_count * HZ * 8 + t / 2) / t;
-               unsigned long tx_pps_count = (strip_info->tx_pps_count * HZ * 8 + t / 2) / t;
-               unsigned long sx_pps_count = (strip_info->sx_pps_count * HZ * 8 + t / 2) / t;
+               unsigned long rx_pps_count =
+                       DIV_ROUND_CLOSEST(strip_info->rx_pps_count*HZ*8, t);
+               unsigned long tx_pps_count =
+                       DIV_ROUND_CLOSEST(strip_info->tx_pps_count*HZ*8, t);
+               unsigned long sx_pps_count =
+                       DIV_ROUND_CLOSEST(strip_info->sx_pps_count*HZ*8, t);
 
                strip_info->pps_timer = jiffies;
                strip_info->rx_pps_count = 0;
@@ -1582,7 +1585,7 @@ static int strip_xmit(struct sk_buff *skb, struct net_device *dev)
 
        if (skb)
                dev_kfree_skb(skb);
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*