aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-03-20 15:36:37 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-22 01:51:25 -0400
commitf02abf1010dfb9fa7f56788fb28bc63b0ea34968 (patch)
tree1481b97bedb853071326190c67677702b71504d7 /drivers/net/wireless/libertas/main.c
parentbbfc6b788f63f079fb8eeeb8d397bb1c0a8065a1 (diff)
libertas: convert to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c45
1 files changed, 29 insertions, 16 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index c27088d0541b..8ae935ac32f1 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1148,6 +1148,17 @@ static void lbs_free_adapter(struct lbs_private *priv)
1148 lbs_deb_leave(LBS_DEB_MAIN); 1148 lbs_deb_leave(LBS_DEB_MAIN);
1149} 1149}
1150 1150
1151static const struct net_device_ops lbs_netdev_ops = {
1152 .ndo_open = lbs_dev_open,
1153 .ndo_stop = lbs_eth_stop,
1154 .ndo_start_xmit = lbs_hard_start_xmit,
1155 .ndo_set_mac_address = lbs_set_mac_address,
1156 .ndo_tx_timeout = lbs_tx_timeout,
1157 .ndo_set_multicast_list = lbs_set_multicast_list,
1158 .ndo_change_mtu = eth_change_mtu,
1159 .ndo_validate_addr = eth_validate_addr,
1160};
1161
1151/** 1162/**
1152 * @brief This function adds the card. it will probe the 1163 * @brief This function adds the card. it will probe the
1153 * card, allocate the lbs_priv and initialize the device. 1164 * card, allocate the lbs_priv and initialize the device.
@@ -1182,19 +1193,13 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
1182 priv->infra_open = 0; 1193 priv->infra_open = 0;
1183 1194
1184 /* Setup the OS Interface to our functions */ 1195 /* Setup the OS Interface to our functions */
1185 dev->open = lbs_dev_open; 1196 dev->netdev_ops = &lbs_netdev_ops;
1186 dev->hard_start_xmit = lbs_hard_start_xmit;
1187 dev->stop = lbs_eth_stop;
1188 dev->set_mac_address = lbs_set_mac_address;
1189 dev->tx_timeout = lbs_tx_timeout;
1190
1191 dev->watchdog_timeo = 5 * HZ; 1197 dev->watchdog_timeo = 5 * HZ;
1192 dev->ethtool_ops = &lbs_ethtool_ops; 1198 dev->ethtool_ops = &lbs_ethtool_ops;
1193#ifdef WIRELESS_EXT 1199#ifdef WIRELESS_EXT
1194 dev->wireless_handlers = (struct iw_handler_def *)&lbs_handler_def; 1200 dev->wireless_handlers = &lbs_handler_def;
1195#endif 1201#endif
1196 dev->flags |= IFF_BROADCAST | IFF_MULTICAST; 1202 dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
1197 dev->set_multicast_list = lbs_set_multicast_list;
1198 1203
1199 SET_NETDEV_DEV(dev, dmdev); 1204 SET_NETDEV_DEV(dev, dmdev);
1200 1205
@@ -1404,6 +1409,14 @@ out:
1404EXPORT_SYMBOL_GPL(lbs_stop_card); 1409EXPORT_SYMBOL_GPL(lbs_stop_card);
1405 1410
1406 1411
1412static const struct net_device_ops mesh_netdev_ops = {
1413 .ndo_open = lbs_dev_open,
1414 .ndo_stop = lbs_mesh_stop,
1415 .ndo_start_xmit = lbs_hard_start_xmit,
1416 .ndo_set_mac_address = lbs_set_mac_address,
1417 .ndo_set_multicast_list = lbs_set_multicast_list,
1418};
1419
1407/** 1420/**
1408 * @brief This function adds mshX interface 1421 * @brief This function adds mshX interface
1409 * 1422 *
@@ -1426,10 +1439,7 @@ static int lbs_add_mesh(struct lbs_private *priv)
1426 mesh_dev->ml_priv = priv; 1439 mesh_dev->ml_priv = priv;
1427 priv->mesh_dev = mesh_dev; 1440 priv->mesh_dev = mesh_dev;
1428 1441
1429 mesh_dev->open = lbs_dev_open; 1442 mesh_dev->netdev_ops = &mesh_netdev_ops;
1430 mesh_dev->hard_start_xmit = lbs_hard_start_xmit;
1431 mesh_dev->stop = lbs_mesh_stop;
1432 mesh_dev->set_mac_address = lbs_set_mac_address;
1433 mesh_dev->ethtool_ops = &lbs_ethtool_ops; 1443 mesh_dev->ethtool_ops = &lbs_ethtool_ops;
1434 memcpy(mesh_dev->dev_addr, priv->dev->dev_addr, 1444 memcpy(mesh_dev->dev_addr, priv->dev->dev_addr,
1435 sizeof(priv->dev->dev_addr)); 1445 sizeof(priv->dev->dev_addr));
@@ -1440,7 +1450,6 @@ static int lbs_add_mesh(struct lbs_private *priv)
1440 mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def; 1450 mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def;
1441#endif 1451#endif
1442 mesh_dev->flags |= IFF_BROADCAST | IFF_MULTICAST; 1452 mesh_dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
1443 mesh_dev->set_multicast_list = lbs_set_multicast_list;
1444 /* Register virtual mesh interface */ 1453 /* Register virtual mesh interface */
1445 ret = register_netdev(mesh_dev); 1454 ret = register_netdev(mesh_dev);
1446 if (ret) { 1455 if (ret) {
@@ -1645,6 +1654,12 @@ out:
1645 lbs_deb_leave(LBS_DEB_MAIN); 1654 lbs_deb_leave(LBS_DEB_MAIN);
1646} 1655}
1647 1656
1657static const struct net_device_ops rtap_netdev_ops = {
1658 .ndo_open = lbs_rtap_open,
1659 .ndo_stop = lbs_rtap_stop,
1660 .ndo_start_xmit = lbs_rtap_hard_start_xmit,
1661};
1662
1648static int lbs_add_rtap(struct lbs_private *priv) 1663static int lbs_add_rtap(struct lbs_private *priv)
1649{ 1664{
1650 int ret = 0; 1665 int ret = 0;
@@ -1664,9 +1679,7 @@ static int lbs_add_rtap(struct lbs_private *priv)
1664 1679
1665 memcpy(rtap_dev->dev_addr, priv->current_addr, ETH_ALEN); 1680 memcpy(rtap_dev->dev_addr, priv->current_addr, ETH_ALEN);
1666 rtap_dev->type = ARPHRD_IEEE80211_RADIOTAP; 1681 rtap_dev->type = ARPHRD_IEEE80211_RADIOTAP;
1667 rtap_dev->open = lbs_rtap_open; 1682 rtap_dev->netdev_ops = &rtap_netdev_ops;
1668 rtap_dev->stop = lbs_rtap_stop;
1669 rtap_dev->hard_start_xmit = lbs_rtap_hard_start_xmit;
1670 rtap_dev->ml_priv = priv; 1683 rtap_dev->ml_priv = priv;
1671 SET_NETDEV_DEV(rtap_dev, priv->dev->dev.parent); 1684 SET_NETDEV_DEV(rtap_dev, priv->dev->dev.parent);
1672 1685