enic: Add new fw devcmd to set mac address of an interface
authorRoopa Prabhu <roprabhu@cisco.com>
Mon, 20 Feb 2012 00:11:53 +0000 (00:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Feb 2012 05:51:41 +0000 (00:51 -0500)
This patch adds a new devcmd CMD_SET_MAC_ADDR to set the mac address of an
interface.

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cisco/enic/enic.h
drivers/net/ethernet/cisco/enic/vnic_dev.c
drivers/net/ethernet/cisco/enic/vnic_dev.h
drivers/net/ethernet/cisco/enic/vnic_devcmd.h

index f7c3067d44854679f94b76810b70e568cc700a9b..06fba3215f4033b2d9e12262f36a7b92c7360af6 100644 (file)
@@ -32,7 +32,7 @@
 
 #define DRV_NAME               "enic"
 #define DRV_DESCRIPTION                "Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION            "2.1.1.35"
+#define DRV_VERSION            "2.1.1.36"
 #define DRV_COPYRIGHT          "Copyright 2008-2011 Cisco Systems, Inc"
 
 #define ENIC_BARS_MAX          6
index 79cb3405bebcda7b5e3bc7a94e2ba797881232de..605b22283be1b0db0dfc66f8311674411c1723b6 100644 (file)
@@ -1023,3 +1023,15 @@ int vnic_dev_deinit_done(struct vnic_dev *vdev, int *status)
 {
        return vnic_dev_cmd_status(vdev, CMD_DEINIT, status);
 }
+
+int vnic_dev_set_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
+{
+       u64 a0, a1;
+       int wait = 1000;
+       int i;
+
+       for (i = 0; i < ETH_ALEN; i++)
+               ((u8 *)&a0)[i] = mac_addr[i];
+
+       return vnic_dev_cmd(vdev, CMD_SET_MAC_ADDR, &a0, &a1, wait);
+}
index e476c737f61d90cc7b8d2d2c0e46efc5116a482d..f3d9b79ba77e653d13fa4630354641d2f7a0d304 100644 (file)
@@ -131,5 +131,6 @@ int vnic_dev_init_prov2(struct vnic_dev *vdev, u8 *buf, u32 len);
 int vnic_dev_enable2(struct vnic_dev *vdev, int active);
 int vnic_dev_enable2_done(struct vnic_dev *vdev, int *status);
 int vnic_dev_deinit_done(struct vnic_dev *vdev, int *status);
+int vnic_dev_set_mac_addr(struct vnic_dev *vdev, u8 *mac_addr);
 
 #endif /* _VNIC_DEV_H_ */
index 8a58dea2fa01578dd1a909ce39621d2414a51df8..23d555255cf8ed99ef3c949ceeb0c3b42822ff9b 100644 (file)
@@ -337,6 +337,15 @@ enum vnic_devcmd_cmd {
         *      (u32)a2 = maximum timer value in usec
         */
        CMD_INTR_COAL_CONVERT = _CMDC(_CMD_DIR_READ, _CMD_VTYPE_ALL, 50),
+
+       /*
+        * cmd_set_mac_addr
+        *      set mac address
+        * in:
+        *   (u48)a0 = mac addr
+        *
+        */
+       CMD_SET_MAC_ADDR = _CMDC(_CMD_DIR_WRITE, _CMD_VTYPE_ENET, 55),
 };
 
 /* CMD_ENABLE2 flags */