Commit 141b9e66 authored by françois romieu's avatar françois romieu Committed by David S. Miller

rtl8150: removal of forward declarations.

Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3235de16
...@@ -169,26 +169,8 @@ struct rtl8150 { ...@@ -169,26 +169,8 @@ struct rtl8150 {
typedef struct rtl8150 rtl8150_t; typedef struct rtl8150 rtl8150_t;
static void fill_skb_pool(rtl8150_t *);
static void free_skb_pool(rtl8150_t *);
static inline struct sk_buff *pull_skb(rtl8150_t *);
static void rtl8150_disconnect(struct usb_interface *intf);
static int rtl8150_probe(struct usb_interface *intf,
const struct usb_device_id *id);
static int rtl8150_suspend(struct usb_interface *intf, pm_message_t message);
static int rtl8150_resume(struct usb_interface *intf);
static const char driver_name [] = "rtl8150"; static const char driver_name [] = "rtl8150";
static struct usb_driver rtl8150_driver = {
.name = driver_name,
.probe = rtl8150_probe,
.disconnect = rtl8150_disconnect,
.id_table = rtl8150_table,
.suspend = rtl8150_suspend,
.resume = rtl8150_resume
};
/* /*
** **
** device related part of the code ** device related part of the code
...@@ -490,44 +472,6 @@ static void read_bulk_callback(struct urb *urb) ...@@ -490,44 +472,6 @@ static void read_bulk_callback(struct urb *urb)
tasklet_schedule(&dev->tl); tasklet_schedule(&dev->tl);
} }
static void rx_fixup(unsigned long data)
{
rtl8150_t *dev;
struct sk_buff *skb;
int status;
dev = (rtl8150_t *)data;
spin_lock_irq(&dev->rx_pool_lock);
fill_skb_pool(dev);
spin_unlock_irq(&dev->rx_pool_lock);
if (test_bit(RX_URB_FAIL, &dev->flags))
if (dev->rx_skb)
goto try_again;
spin_lock_irq(&dev->rx_pool_lock);
skb = pull_skb(dev);
spin_unlock_irq(&dev->rx_pool_lock);
if (skb == NULL)
goto tlsched;
dev->rx_skb = skb;
usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
try_again:
status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC);
if (status == -ENODEV) {
netif_device_detach(dev->netdev);
} else if (status) {
set_bit(RX_URB_FAIL, &dev->flags);
goto tlsched;
} else {
clear_bit(RX_URB_FAIL, &dev->flags);
}
return;
tlsched:
tasklet_schedule(&dev->tl);
}
static void write_bulk_callback(struct urb *urb) static void write_bulk_callback(struct urb *urb)
{ {
rtl8150_t *dev; rtl8150_t *dev;
...@@ -665,6 +609,42 @@ static void free_skb_pool(rtl8150_t *dev) ...@@ -665,6 +609,42 @@ static void free_skb_pool(rtl8150_t *dev)
dev_kfree_skb(dev->rx_skb_pool[i]); dev_kfree_skb(dev->rx_skb_pool[i]);
} }
static void rx_fixup(unsigned long data)
{
struct rtl8150 *dev = (struct rtl8150 *)data;
struct sk_buff *skb;
int status;
spin_lock_irq(&dev->rx_pool_lock);
fill_skb_pool(dev);
spin_unlock_irq(&dev->rx_pool_lock);
if (test_bit(RX_URB_FAIL, &dev->flags))
if (dev->rx_skb)
goto try_again;
spin_lock_irq(&dev->rx_pool_lock);
skb = pull_skb(dev);
spin_unlock_irq(&dev->rx_pool_lock);
if (skb == NULL)
goto tlsched;
dev->rx_skb = skb;
usb_fill_bulk_urb(dev->rx_urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
dev->rx_skb->data, RTL8150_MTU, read_bulk_callback, dev);
try_again:
status = usb_submit_urb(dev->rx_urb, GFP_ATOMIC);
if (status == -ENODEV) {
netif_device_detach(dev->netdev);
} else if (status) {
set_bit(RX_URB_FAIL, &dev->flags);
goto tlsched;
} else {
clear_bit(RX_URB_FAIL, &dev->flags);
}
return;
tlsched:
tasklet_schedule(&dev->tl);
}
static int enable_net_traffic(rtl8150_t * dev) static int enable_net_traffic(rtl8150_t * dev)
{ {
u8 cr, tcr, rcr, msr; u8 cr, tcr, rcr, msr;
...@@ -989,6 +969,15 @@ static void rtl8150_disconnect(struct usb_interface *intf) ...@@ -989,6 +969,15 @@ static void rtl8150_disconnect(struct usb_interface *intf)
} }
} }
static struct usb_driver rtl8150_driver = {
.name = driver_name,
.probe = rtl8150_probe,
.disconnect = rtl8150_disconnect,
.id_table = rtl8150_table,
.suspend = rtl8150_suspend,
.resume = rtl8150_resume
};
static int __init usb_rtl8150_init(void) static int __init usb_rtl8150_init(void)
{ {
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
......
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