diff options
author | Jon Mason <jon.mason@exar.com> | 2010-11-10 23:25:57 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-11 12:30:21 -0500 |
commit | e8ac175615b9458a00193c55617b5b8865e67817 (patch) | |
tree | 31c688b4b9d2a3578ef712d05534bca4395e6281 /drivers/net/vxge/vxge-ethtool.c | |
parent | 8424e00dfd5282026a93996a165fc4079d382169 (diff) |
vxge: add support for ethtool firmware flashing
Add the ability in the vxge driver to flash firmware via ethtool.
Updated to include comments from Ben Hutchings.
Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Ram Vepa <ram.vepa@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge/vxge-ethtool.c')
-rw-r--r-- | drivers/net/vxge/vxge-ethtool.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/vxge/vxge-ethtool.c b/drivers/net/vxge/vxge-ethtool.c index f8fd8da4f173..3d2cd6acf30a 100644 --- a/drivers/net/vxge/vxge-ethtool.c +++ b/drivers/net/vxge/vxge-ethtool.c | |||
@@ -1153,6 +1153,25 @@ static int vxge_set_flags(struct net_device *dev, u32 data) | |||
1153 | return 0; | 1153 | return 0; |
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | static int vxge_fw_flash(struct net_device *dev, struct ethtool_flash *parms) | ||
1157 | { | ||
1158 | struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev); | ||
1159 | |||
1160 | if (vdev->max_vpath_supported != VXGE_HW_MAX_VIRTUAL_PATHS) { | ||
1161 | printk(KERN_INFO "Single Function Mode is required to flash the" | ||
1162 | " firmware\n"); | ||
1163 | return -EINVAL; | ||
1164 | } | ||
1165 | |||
1166 | if (netif_running(dev)) { | ||
1167 | printk(KERN_INFO "Interface %s must be down to flash the " | ||
1168 | "firmware\n", dev->name); | ||
1169 | return -EBUSY; | ||
1170 | } | ||
1171 | |||
1172 | return vxge_fw_upgrade(vdev, parms->data, 1); | ||
1173 | } | ||
1174 | |||
1156 | static const struct ethtool_ops vxge_ethtool_ops = { | 1175 | static const struct ethtool_ops vxge_ethtool_ops = { |
1157 | .get_settings = vxge_ethtool_gset, | 1176 | .get_settings = vxge_ethtool_gset, |
1158 | .set_settings = vxge_ethtool_sset, | 1177 | .set_settings = vxge_ethtool_sset, |
@@ -1175,6 +1194,7 @@ static const struct ethtool_ops vxge_ethtool_ops = { | |||
1175 | .get_sset_count = vxge_ethtool_get_sset_count, | 1194 | .get_sset_count = vxge_ethtool_get_sset_count, |
1176 | .get_ethtool_stats = vxge_get_ethtool_stats, | 1195 | .get_ethtool_stats = vxge_get_ethtool_stats, |
1177 | .set_flags = vxge_set_flags, | 1196 | .set_flags = vxge_set_flags, |
1197 | .flash_device = vxge_fw_flash, | ||
1178 | }; | 1198 | }; |
1179 | 1199 | ||
1180 | void vxge_initialize_ethtool_ops(struct net_device *ndev) | 1200 | void vxge_initialize_ethtool_ops(struct net_device *ndev) |