提交 e2270ea6 编写于 作者: D David S. Miller

netdevice: Kill 'feature' test macros.

Almost all of these have long outstayed their welcome.

And for every one of these macros, there are 10 features for which we
didn't add macros.

Let's just delete them all, and get out of habit of doing things this
way.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Acked-by: NStephen Hemminger <shemminger@vyatta.com>
Acked-by: NArnd Bergmann <arnd@arndb.de>
上级 b691347a
......@@ -2421,7 +2421,6 @@ static int __devinit enable_msix(struct adapter *adapter)
return err;
}
#ifdef HAVE_NET_DEVICE_OPS
static const struct net_device_ops cxgb4vf_netdev_ops = {
.ndo_open = cxgb4vf_open,
.ndo_stop = cxgb4vf_stop,
......@@ -2437,7 +2436,6 @@ static const struct net_device_ops cxgb4vf_netdev_ops = {
.ndo_poll_controller = cxgb4vf_poll_controller,
#endif
};
#endif
/*
* "Probe" a device: initialize a device and construct all kernel and driver
......@@ -2611,22 +2609,7 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
if (pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
#ifdef HAVE_NET_DEVICE_OPS
netdev->netdev_ops = &cxgb4vf_netdev_ops;
#else
netdev->vlan_rx_register = cxgb4vf_vlan_rx_register;
netdev->open = cxgb4vf_open;
netdev->stop = cxgb4vf_stop;
netdev->hard_start_xmit = t4vf_eth_xmit;
netdev->get_stats = cxgb4vf_get_stats;
netdev->set_rx_mode = cxgb4vf_set_rxmode;
netdev->do_ioctl = cxgb4vf_do_ioctl;
netdev->change_mtu = cxgb4vf_change_mtu;
netdev->set_mac_address = cxgb4vf_set_mac_addr;
#ifdef CONFIG_NET_POLL_CONTROLLER
netdev->poll_controller = cxgb4vf_poll_controller;
#endif
#endif
SET_ETHTOOL_OPS(netdev, &cxgb4vf_ethtool_ops);
/*
......
......@@ -671,7 +671,6 @@ static int ft1000_reset_card(struct net_device *dev)
return TRUE;
}
#ifdef HAVE_NET_DEVICE_OPS
static const struct net_device_ops ftnet_ops =
{
.ndo_open = &ft1000_open,
......@@ -679,7 +678,6 @@ static const struct net_device_ops ftnet_ops =
.ndo_start_xmit = &ft1000_start_xmit,
.ndo_get_stats = &ft1000_netdev_stats,
};
#endif
//---------------------------------------------------------------------------
......@@ -764,14 +762,7 @@ int init_ft1000_netdev(struct ft1000_device *ft1000dev)
INIT_LIST_HEAD(&pInfo->nodes.list);
#ifdef HAVE_NET_DEVICE_OPS
netdev->netdev_ops = &ftnet_ops;
#else
netdev->hard_start_xmit = &ft1000_start_xmit;
netdev->get_stats = &ft1000_netdev_stats;
netdev->open = &ft1000_open;
netdev->stop = &ft1000_close;
#endif
ft1000dev->net = netdev;
......
......@@ -990,14 +990,7 @@ struct wl_private
#endif // USE_WDS
}; // wl_private
#ifdef HAVE_NETDEV_PRIV
#define wl_priv(dev) ((struct wl_private *) netdev_priv(dev))
#else
extern inline struct wl_private *wl_priv(struct net_device *dev)
{
return dev->priv;
}
#endif
/********************************************************************/
/* Locking and synchronization functions */
......
......@@ -60,11 +60,6 @@ struct wireless_dev;
#define SET_ETHTOOL_OPS(netdev,ops) \
( (netdev)->ethtool_ops = (ops) )
#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
functions are available. */
#define HAVE_FREE_NETDEV /* free_netdev() */
#define HAVE_NETDEV_PRIV /* netdev_priv() */
/* hardware address assignment types */
#define NET_ADDR_PERM 0 /* address is permanent (default) */
#define NET_ADDR_RANDOM 1 /* address is generated randomly */
......@@ -313,7 +308,6 @@ struct header_ops {
const void *saddr, unsigned len);
int (*parse)(const struct sk_buff *skb, unsigned char *haddr);
int (*rebuild)(struct sk_buff *skb);
#define HAVE_HEADER_CACHE
int (*cache)(const struct neighbour *neigh, struct hh_cache *hh);
void (*cache_update)(struct hh_cache *hh,
const struct net_device *dev,
......@@ -887,7 +881,6 @@ struct netdev_tc_txq {
* Must return >0 or -errno if it changed dev->features itself.
*
*/
#define HAVE_NET_DEVICE_OPS
struct net_device_ops {
int (*ndo_init)(struct net_device *dev);
void (*ndo_uninit)(struct net_device *dev);
......@@ -1781,8 +1774,6 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd,
DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
#define HAVE_NETIF_QUEUE
extern void __netif_schedule(struct Qdisc *q);
static inline void netif_schedule_queue(struct netdev_queue *txq)
......@@ -2058,10 +2049,8 @@ extern void dev_kfree_skb_irq(struct sk_buff *skb);
*/
extern void dev_kfree_skb_any(struct sk_buff *skb);
#define HAVE_NETIF_RX 1
extern int netif_rx(struct sk_buff *skb);
extern int netif_rx_ni(struct sk_buff *skb);
#define HAVE_NETIF_RECEIVE_SKB 1
extern int netif_receive_skb(struct sk_buff *skb);
extern gro_result_t dev_gro_receive(struct napi_struct *napi,
struct sk_buff *skb);
......@@ -2241,7 +2230,6 @@ extern void netif_device_attach(struct net_device *dev);
/*
* Network interface message level settings
*/
#define HAVE_NETIF_MSG 1
enum {
NETIF_MSG_DRV = 0x0001,
......
......@@ -750,7 +750,6 @@ void interface_rx(struct net_device *soft_iface,
return;
}
#ifdef HAVE_NET_DEVICE_OPS
static const struct net_device_ops bat_netdev_ops = {
.ndo_open = interface_open,
.ndo_stop = interface_release,
......@@ -760,7 +759,6 @@ static const struct net_device_ops bat_netdev_ops = {
.ndo_start_xmit = interface_tx,
.ndo_validate_addr = eth_validate_addr
};
#endif
static void interface_setup(struct net_device *dev)
{
......@@ -769,16 +767,7 @@ static void interface_setup(struct net_device *dev)
ether_setup(dev);
#ifdef HAVE_NET_DEVICE_OPS
dev->netdev_ops = &bat_netdev_ops;
#else
dev->open = interface_open;
dev->stop = interface_release;
dev->get_stats = interface_stats;
dev->set_mac_address = interface_set_mac_addr;
dev->change_mtu = interface_change_mtu;
dev->hard_start_xmit = interface_tx;
#endif
dev->destructor = free_netdev;
dev->tx_queue_len = 0;
......@@ -885,13 +874,8 @@ void softif_destroy(struct net_device *soft_iface)
int softif_is_valid(const struct net_device *net_dev)
{
#ifdef HAVE_NET_DEVICE_OPS
if (net_dev->netdev_ops->ndo_start_xmit == interface_tx)
return 1;
#else
if (net_dev->hard_start_xmit == interface_tx)
return 1;
#endif
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册