]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - net/ethernet/eth.c
net: Add alloc_netdev_mqs function
[linux-2.6.git] / net / ethernet / eth.c
index 215c83986a9d4562f472a07e05bbbf607c56bbb0..f9d7ac924f159db5d4ffb26f394021923bdf7065 100644 (file)
@@ -347,10 +347,11 @@ void ether_setup(struct net_device *dev)
 EXPORT_SYMBOL(ether_setup);
 
 /**
- * alloc_etherdev_mq - Allocates and sets up an Ethernet device
+ * alloc_etherdev_mqs - Allocates and sets up an Ethernet device
  * @sizeof_priv: Size of additional driver-private structure to be allocated
  *     for this Ethernet device
- * @queue_count: The number of queues this device has.
+ * @txqs: The number of TX queues this device has.
+ * @txqs: The number of RX queues this device has.
  *
  * Fill in the fields of the device structure with Ethernet-generic
  * values. Basically does everything except registering the device.
@@ -360,14 +361,15 @@ EXPORT_SYMBOL(ether_setup);
  * this private data area.
  */
 
-struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count)
+struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
+                                     unsigned int rxqs)
 {
-       return alloc_netdev_mq(sizeof_priv, "eth%d", ether_setup, queue_count);
+       return alloc_netdev_mqs(sizeof_priv, "eth%d", ether_setup, txqs, rxqs);
 }
-EXPORT_SYMBOL(alloc_etherdev_mq);
+EXPORT_SYMBOL(alloc_etherdev_mqs);
 
 static size_t _format_mac_addr(char *buf, int buflen,
-                               const unsigned char *addr, int len)
+                              const unsigned char *addr, int len)
 {
        int i;
        char *cp = buf;
@@ -376,7 +378,7 @@ static size_t _format_mac_addr(char *buf, int buflen,
                cp += scnprintf(cp, buflen - (cp - buf), "%02x", addr[i]);
                if (i == len - 1)
                        break;
-               cp += strlcpy(cp, ":", buflen - (cp - buf));
+               cp += scnprintf(cp, buflen - (cp - buf), ":");
        }
        return cp - buf;
 }
@@ -386,7 +388,7 @@ ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len)
        size_t l;
 
        l = _format_mac_addr(buf, PAGE_SIZE, addr, len);
-       l += strlcpy(buf + l, "\n", PAGE_SIZE - l);
-       return ((ssize_t) l);
+       l += scnprintf(buf + l, PAGE_SIZE - l, "\n");
+       return (ssize_t)l;
 }
 EXPORT_SYMBOL(sysfs_format_mac);