Commit 0710f637 authored by Gilles Chanteperdrix's avatar Gilles Chanteperdrix Committed by Philippe Gerum
Browse files

rtnet: remove now useless macros

RTNET_SET_MODULE_OWNER, RTNET_MOD_INC_USE_COUNT, RTNET_MOD_DEC_USE_COUNT
parent 72308768
......@@ -359,10 +359,6 @@ static void tap_dev_setup(struct net_device *dev)
#endif /* !HAVE_NET_DEVICE_OPS */
dev->mtu = 1500;
dev->flags &= ~IFF_MULTICAST;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
SET_MODULE_OWNER(dev);
#endif
}
......@@ -383,7 +379,6 @@ void cleanup_tap_devices(void)
rtdev->hard_start_xmit = tap_device[i].orig_xmit;
if (rtdev->features & NETIF_F_LLTX)
rtdev->start_xmit = tap_device[i].orig_xmit;
RTNET_MOD_DEC_USE_COUNT_EX(rtdev->rt_owner);
mutex_unlock(&rtdev->nrt_lock);
rtdev_dereference(rtdev);
......@@ -495,7 +490,6 @@ int __init rtcap_init(void)
rtdev->start_xmit = rtdev->hard_start_xmit;
tap_device[i].present |= XMIT_HOOK;
RTNET_MOD_INC_USE_COUNT_EX(rtdev->rt_owner);
mutex_unlock(&rtdev->nrt_lock);
......
......@@ -650,7 +650,6 @@ static int rtl8139_init_board (struct pci_dev *pdev,
rt_rtdev_connect(rtdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(rtdev);
rtdev->vers = RTDEV_VERS_2_0;
tp = rtdev->priv;
tp->pci_dev = pdev;
......@@ -1166,8 +1165,6 @@ static int rtl8139_open (struct rtnet_device *rtdev)
rtl8139_init_ring (rtdev);
rtl8139_hw_start (rtdev);
RTNET_MOD_INC_USE_COUNT;
return 0;
}
......@@ -1755,8 +1752,6 @@ static int rtl8139_close (struct rtnet_device *rtdev)
if (rtl_chip_info[tp->chipset].flags & HasHltClk)
RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */
RTNET_MOD_DEC_USE_COUNT;
return 0;
}
......
......@@ -1004,7 +1004,6 @@ static int at91ether_setup_rt(unsigned long phy_type, unsigned short phy_address
rtdev_alloc_name(dev, "rteth%d");
rt_rtdev_connect(dev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(dev);
dev->vers = RTDEV_VERS_2_0;
/* Get I/O base address and IRQ */
......
......@@ -731,7 +731,6 @@ static int e1000_probe(struct pci_dev *pdev,
rt_rtdev_connect(netdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(netdev);
// SET_NETDEV_DEV(netdev, &pdev->dev);
netdev->vers = RTDEV_VERS_2_0;
......
......@@ -4011,7 +4011,6 @@ static int e1000_probe(struct pci_dev *pdev,
rtdev_alloc_name(netdev, "rteth%d");
rt_rtdev_connect(netdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(netdev);
netdev->vers = RTDEV_VERS_2_0;
netdev->irq = pdev->irq;
......
......@@ -679,7 +679,6 @@ static int speedo_found1(struct pci_dev *pdev,
rtdev_alloc_name(rtdev, "rteth%d");
memset(rtdev->priv, 0, sizeof(struct speedo_private));
rt_rtdev_connect(rtdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(rtdev);
rtdev->vers = RTDEV_VERS_2_0;
// *** RTnet ***
......@@ -878,8 +877,6 @@ speedo_open(struct rtnet_device *rtdev)
if (speedo_debug > 1)
printk(KERN_DEBUG "%s: speedo_open() irq %d.\n", rtdev->name, rtdev->irq);
RTNET_MOD_INC_USE_COUNT;
pci_set_power_state(sp->pdev, 0);
/* Set up the Tx queue early.. */
......@@ -897,7 +894,6 @@ speedo_open(struct rtnet_device *rtdev)
speedo_interrupt, RTDM_IRQTYPE_SHARED,
"rt_eepro100", rtdev);
if (retval) {
RTNET_MOD_DEC_USE_COUNT;
return retval;
}
// *** RTnet ***
......@@ -1699,8 +1695,6 @@ speedo_close(struct rtnet_device *rtdev)
pci_set_power_state(sp->pdev, 2);
RTNET_MOD_DEC_USE_COUNT;
return 0;
}
......
......@@ -387,7 +387,6 @@ static void eth1394_add_host (struct hpsb_host *host)
rtdev_alloc_name(dev, "rteth%d");
memset(dev->priv, 0, sizeof(struct eth1394_priv));
rt_rtdev_connect(dev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(dev);
//dev->init = eth1394_init_dev;
......
......@@ -1066,7 +1066,6 @@ static int vortex_probe1(struct pci_dev *pdev,
rtdev_alloc_name(rtdev, "rteth%d");
memset(rtdev->priv, 0, sizeof(*vp));
rt_rtdev_connect(rtdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(rtdev);
rtdev->vers = RTDEV_VERS_2_0;
// *** RTnet ***
......@@ -1883,8 +1882,6 @@ vortex_open(struct rtnet_device *rtdev)
int i;
int retval;
RTNET_MOD_INC_USE_COUNT;
// *** RTnet ***
rt_stack_connect(rtdev, &STACK_manager);
......@@ -1941,7 +1938,6 @@ vortex_open(struct rtnet_device *rtdev)
rt_stack_disconnect(rtdev);
// *** RTnet ***
out:
RTNET_MOD_DEC_USE_COUNT;
if (vortex_debug > 1)
printk(KERN_ERR "%s: vortex_open() fails: returning %d\n", rtdev->name, retval);
return retval;
......@@ -2955,8 +2951,6 @@ vortex_close(struct rtnet_device *rtdev)
}
}
RTNET_MOD_DEC_USE_COUNT;
return 0;
}
......
......@@ -1131,7 +1131,6 @@ static int e1000_probe(struct pci_dev *pdev,
memset(netdev->priv, 0, sizeof(struct e1000_adapter));
rt_rtdev_connect(netdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(netdev);
// SET_NETDEV_DEV(netdev, &pdev->dev);
netdev->vers = RTDEV_VERS_2_0;
......
......@@ -708,7 +708,7 @@ extern int _kc_is_valid_ether_addr(u8 *addr);
#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
ADVERTISE_100HALF | ADVERTISE_100FULL)
ADVERTISE_100HALF | ADVERTISE_100FULL)
/* Expansion register for auto-negotiation. */
#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
#endif
......@@ -1076,8 +1076,8 @@ static inline int _kc_pci_dma_mapping_error(dma_addr_t dma_addr)
#undef find_next_bit
#define find_next_bit _kc_find_next_bit
extern unsigned long _kc_find_next_bit(const unsigned long *addr,
unsigned long size,
unsigned long offset);
unsigned long size,
unsigned long offset);
#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
#endif /* 2.6.0 => 2.5.28 */
......@@ -1102,12 +1102,12 @@ extern unsigned long _kc_find_next_bit(const unsigned long *addr,
#define bitmap_zero _kc_bitmap_zero
static inline void _kc_bitmap_zero(unsigned long *dst, int nbits)
{
if (nbits <= BITS_PER_LONG)
*dst = 0UL;
else {
int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
memset(dst, 0, len);
}
if (nbits <= BITS_PER_LONG)
*dst = 0UL;
else {
int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
memset(dst, 0, len);
}
}
#endif /* < 2.6.6 */
......@@ -1185,34 +1185,34 @@ static inline unsigned long _kc_msleep_interruptible(unsigned int msecs)
#undef pci_save_state
#endif
#define pci_save_state(X) { \
int i; \
if (adapter->pci_state) { \
for (i = 0; i < 16; i++) { \
pci_read_config_dword((X), \
i * 4, \
&adapter->pci_state[i]); \
} \
} \
int i; \
if (adapter->pci_state) { \
for (i = 0; i < 16; i++) { \
pci_read_config_dword((X), \
i * 4, \
&adapter->pci_state[i]); \
} \
} \
}
#ifdef pci_restore_state
#undef pci_restore_state
#endif
#define pci_restore_state(X) { \
int i; \
if (adapter->pci_state) { \
for (i = 0; i < 16; i++) { \
pci_write_config_dword((X), \
i * 4, \
adapter->pci_state[i]); \
} \
} else { \
for (i = 0; i < 6; i++) { \
pci_write_config_dword((X), \
PCI_BASE_ADDRESS_0 + (i * 4), \
(X)->resource[i].start); \
} \
} \
int i; \
if (adapter->pci_state) { \
for (i = 0; i < 16; i++) { \
pci_write_config_dword((X), \
i * 4, \
adapter->pci_state[i]); \
} \
} else { \
for (i = 0; i < 6; i++) { \
pci_write_config_dword((X), \
PCI_BASE_ADDRESS_0 + (i * 4), \
(X)->resource[i].start); \
} \
} \
}
#endif /* 2.4.6 <= x < 2.6.10 */
......@@ -1310,7 +1310,7 @@ extern void *_kc_kzalloc(size_t size, int flags);
#ifndef netdev_alloc_skb
#define netdev_alloc_skb _kc_netdev_alloc_skb
extern struct sk_buff *_kc_netdev_alloc_skb(struct net_device *dev,
unsigned int length);
unsigned int length);
#endif
#ifndef skb_is_gso
......@@ -1341,7 +1341,7 @@ static inline int _kc_skb_is_gso(const struct sk_buff *skb)
#ifndef RHEL_RELEASE_VERSION
#define RHEL_RELEASE_VERSION(a,b) 0
#endif
#if (!(( RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(4,4) ) && ( RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,0) ) || ( RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(5,0) )))
#if (!(( RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(4,4) ) && ( RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,0) ) || ( RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(5,0) )))
typedef irqreturn_t (*irq_handler_t)(int, void*, struct pt_regs *);
#endif
typedef irqreturn_t (*new_handler_t)(int, void*);
......@@ -1456,7 +1456,7 @@ do { \
#define skb_network_header(skb) (skb->nh.raw)
#define skb_tail_pointer(skb) skb->tail
#define skb_copy_to_linear_data_offset(skb, offset, from, len) \
memcpy(skb->data + offset, from, len)
memcpy(skb->data + offset, from, len)
#define skb_network_header_len(skb) (skb->h.raw - skb->nh.raw)
#define pci_register_driver pci_module_init
#define skb_mac_header(skb) skb->mac.raw
......@@ -1498,11 +1498,6 @@ extern int __kc_adapter_clean(struct net_device *, int *);
/*****************************************************************************/
#if ( LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22) )
#undef ETHTOOL_GPERMADDR
#undef SET_MODULE_OWNER
#define SET_MODULE_OWNER(dev) do { } while (0)
#endif /* > 2.6.22 */
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) )
#undef dev_get_by_name
......@@ -1511,4 +1506,3 @@ extern int __kc_adapter_clean(struct net_device *, int *);
#endif /* < 2.6.24 */
#endif /* _KCOMPAT_H_ */
......@@ -282,8 +282,6 @@ static int rt2x00_open (struct rtnet_device *rtnet_dev) {
rtnetif_start_queue(rtnet_dev);
RTNET_MOD_INC_USE_COUNT;
DEBUG("Exit success.\n");
return 0;
......@@ -311,8 +309,6 @@ static int rt2x00_close (struct rtnet_device *rtnet_dev) {
rtnetif_stop_queue(rtnet_dev);
rt_stack_disconnect(rtnet_dev);
RTNET_MOD_DEC_USE_COUNT;
return 0;
}
......@@ -362,7 +358,6 @@ struct rtnet_device * rt2x00_core_probe(struct _rt2x00_dev_handler * handler,
goto exit;
rt_rtdev_connect(rtnet_dev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(rtnet_dev);
rtnet_dev->vers = RTDEV_VERS_2_0;
rtwlan_dev = rtnetdev_priv(rtnet_dev);
......
......@@ -1658,7 +1658,6 @@ static int fec_probe(struct platform_device *pdev)
/* RTnet */
rtdev_alloc_name(ndev, "rteth%d");
rt_rtdev_connect(ndev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(ndev);
ndev->vers = RTDEV_VERS_2_0;
/* setup board info structure */
......
......@@ -1190,7 +1190,6 @@ static int igb_probe(struct pci_dev *pdev,
rtdev_alloc_name(netdev, "rteth%d");
rt_rtdev_connect(netdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(netdev);
netdev->vers = RTDEV_VERS_2_0;
......
......@@ -39,8 +39,6 @@ static struct rtnet_device* rt_loopback_dev;
*/
static int rt_loopback_open (struct rtnet_device *rtdev)
{
RTNET_MOD_INC_USE_COUNT;
rt_stack_connect(rtdev, &STACK_manager);
rtnetif_start_queue(rtdev);
......@@ -57,8 +55,6 @@ static int rt_loopback_close (struct rtnet_device *rtdev)
rtnetif_stop_queue(rtdev);
rt_stack_disconnect(rtdev);
RTNET_MOD_DEC_USE_COUNT;
return 0;
}
......@@ -105,7 +101,6 @@ static int __init loopback_init(void)
return -ENODEV;
rt_rtdev_connect(rtdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(rtdev);
strcpy(rtdev->name, "rtlo");
......
......@@ -980,8 +980,6 @@ static int macb_open(struct rtnet_device *rtdev)
rtnetif_start_queue(rtdev);
RTNET_MOD_INC_USE_COUNT;
return 0;
}
......@@ -1004,8 +1002,6 @@ static int macb_close(struct rtnet_device *rtdev)
rt_stack_disconnect(rtdev);
macb_free_consistent(bp);
RTNET_MOD_DEC_USE_COUNT;
return 0;
}
......@@ -1163,7 +1159,6 @@ static int __init macb_probe(struct platform_device *pdev)
rtdev_alloc_name(rtdev, "rteth%d");
rt_rtdev_connect(rtdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(rtdev);
rtdev->vers = RTDEV_VERS_2_0;
/* TODO: Actually, we have some interesting features... */
......
......@@ -1168,7 +1168,6 @@ eagain:
static int
mpc5xxx_fec_open(struct rtnet_device *dev)
{
RTNET_MOD_INC_USE_COUNT;
return mpc5xxx_fec_setup(dev,0);
}
......@@ -1639,7 +1638,6 @@ static int
mpc5xxx_fec_close(struct rtnet_device *dev)
{
int ret = mpc5xxx_fec_cleanup(dev,0);
RTNET_MOD_DEC_USE_COUNT;
return ret;
}
......@@ -1961,7 +1959,6 @@ mpc5xxx_fec_init(void)
rtdev_alloc_name(dev, "rteth%d");
memset(dev->priv, 0, sizeof(*priv));
rt_rtdev_connect(dev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(dev);
dev->vers = RTDEV_VERS_2_0;
......
......@@ -805,8 +805,6 @@ fcc_enet_close(struct rtnet_device *rtdev)
/* Don't know what to do yet. */
rtnetif_stop_queue(rtdev);
MOD_DEC_USE_COUNT;
return 0;
}
......@@ -1651,7 +1649,6 @@ int __init fec_enet_init(void)
}
rtdev_alloc_name(rtdev, "rteth%d");
rt_rtdev_connect(rtdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(rtdev);
rtdev->vers = RTDEV_VERS_2_0;
cep = (struct fcc_enet_private *)rtdev->priv;
......@@ -2233,14 +2230,12 @@ fcc_enet_open(struct rtnet_device *rtdev)
mii_do_cmd(dev, phy_cmd_relink);
#endif /* CONFIG_PM826 */
rtnetif_start_queue(rtdev);
MOD_INC_USE_COUNT;
return 0; /* Success */
}
return -ENODEV; /* No PHY we understand */
#else
fep->link = 1;
rtnetif_start_queue(rtdev);
MOD_INC_USE_COUNT;
return 0; /* Always succeed */
#endif /* CONFIG_RTAI_RTNET_USE_MDIO */
}
......
......@@ -194,8 +194,6 @@ static int CPMVEC_ENET;
static int
scc_enet_open(struct rtnet_device *rtdev)
{
RTNET_MOD_INC_USE_COUNT;
/* I should reset the ring buffers here, but I don't yet know
* a simple way to do that.
*/
......@@ -589,8 +587,6 @@ scc_enet_close(struct rtnet_device *rtdev)
*/
rtnetif_stop_queue(rtdev);
RTNET_MOD_DEC_USE_COUNT;
return 0;
}
......@@ -747,7 +743,6 @@ int __init scc_enet_init(void)
}
rtdev_alloc_name(rtdev, "rteth%d");
rt_rtdev_connect(rtdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(rtdev);
rtdev->vers = RTDEV_VERS_2_0;
cep = (struct scc_enet_private *)rtdev->priv;
......
......@@ -1566,8 +1566,6 @@ fec_enet_open(struct rtnet_device *rtdev)
* a simple way to do that.
*/
RTNET_MOD_INC_USE_COUNT;
#ifdef CONFIG_RTAI_RTNET_USE_MDIO
fep->sequence_done = 0;
fep->link = 0;
......@@ -1629,7 +1627,6 @@ fec_enet_close(struct rtnet_device *rtdev)
fec_stop(rtdev);
RTNET_MOD_DEC_USE_COUNT;
return 0;
}
......@@ -1959,7 +1956,6 @@ int __init fec_enet_init(void)
}
rtdev_alloc_name(rtdev, "rteth%d");
rt_rtdev_connect(rtdev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(rtdev);
rtdev->vers = RTDEV_VERS_2_0;
fep = (struct fec_enet_private *)rtdev->priv;
......
......@@ -785,7 +785,6 @@ static int natsemi_probe1 (struct pci_dev *pdev,
}
rtdev_alloc_name(dev, "rteth%d");
rt_rtdev_connect(dev, &RTDEV_manager);
RTNET_SET_MODULE_OWNER(dev);
dev->vers = RTDEV_VERS_2_0;
/*** RTnet ***/
......@@ -1129,8 +1128,6 @@ static int netdev_open(struct rtnet_device *dev)
long ioaddr = dev->base_addr;
int i;
RTNET_MOD_INC_USE_COUNT;
/* Reset the chip, just in case. */
natsemi_reset(dev);
......@@ -1141,7 +1138,6 @@ static int netdev_open(struct rtnet_device *dev)
/*** RTnet ***/
/* i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev);*/
if (i) {
RTNET_MOD_DEC_USE_COUNT;
return i;
}
......@@ -1151,7 +1147,6 @@ static int netdev_open(struct rtnet_device *dev)
i = alloc_ring(dev);
if (i < 0) {
rtdm_irq_free(&np->irq_handle);
RTNET_MOD_DEC_USE_COUNT;
return i;
}
init_ring(dev);
......@@ -2652,8 +2647,6 @@ static int netdev_close(struct rtnet_device *dev)
}
}
RTNET_MOD_DEC_USE_COUNT;
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment