ipw2x00: convert infrastructure for use by net_device_ops
authorStephen Hemminger <shemminger@vyatta.com>
Fri, 20 Mar 2009 19:36:39 +0000 (19:36 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Mar 2009 05:55:31 +0000 (22:55 -0700)
Expose routines so drivers can hook. Only set ptrs in netdev
if using old compat code.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wireless/ipw2x00/ieee80211.h
drivers/net/wireless/ipw2x00/libipw_module.c
drivers/net/wireless/ipw2x00/libipw_tx.c

index 1978fcd833dc178b0f254153a882aed40fabe70f..70755c1336d573d93f7fafb9aa60aef0fa2143db 100644 (file)
@@ -1016,6 +1016,7 @@ static inline int ieee80211_is_cck_rate(u8 rate)
 /* ieee80211.c */
 extern void free_ieee80211(struct net_device *dev);
 extern struct net_device *alloc_ieee80211(int sizeof_priv);
+extern int ieee80211_change_mtu(struct net_device *dev, int new_mtu);
 
 extern void ieee80211_networks_age(struct ieee80211_device *ieee,
                                   unsigned long age_secs);
index b81df1ad190df8ea386fc029581790ca2295fe9c..92a26922e792d73721a2e4ca0ed3c2c3a125fcb5 100644 (file)
@@ -131,13 +131,14 @@ static void ieee80211_networks_initialize(struct ieee80211_device *ieee)
                              &ieee->network_free_list);
 }
 
-static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
+int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
 {
        if ((new_mtu < 68) || (new_mtu > IEEE80211_DATA_LEN))
                return -EINVAL;
        dev->mtu = new_mtu;
        return 0;
 }
+EXPORT_SYMBOL(ieee80211_change_mtu);
 
 struct net_device *alloc_ieee80211(int sizeof_priv)
 {
@@ -153,8 +154,10 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
                goto failed;
        }
        ieee = netdev_priv(dev);
+#ifdef CONFIG_COMPAT_NET_DEV_OPS
        dev->hard_start_xmit = ieee80211_xmit;
        dev->change_mtu = ieee80211_change_mtu;
+#endif
 
        ieee->dev = dev;
 
index 0da4a0a73a4af713113d86c4a264337bbaff2c6c..65a8195b3d90c89fb8c3ace8954827c9a7f5908d 100644 (file)
@@ -541,5 +541,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
        dev->stats.tx_errors++;
        return 1;
 }
+EXPORT_SYMBOL(ieee80211_xmit);
 
 EXPORT_SYMBOL(ieee80211_txb_free);