vserver 1.9.3
[linux-2.6.git] / drivers / usb / net / pegasus.c
index 5174c9f..c515916 100644 (file)
@@ -78,8 +78,8 @@ static struct usb_device_id pegasus_ids[] = {
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-MODULE_PARM(loopback, "i");
-MODULE_PARM(mii_mode, "i");
+module_param(loopback, bool, 0);
+module_param(mii_mode, bool, 0);
 MODULE_PARM_DESC(loopback, "Enable MAC loopback mode (bit 0)");
 MODULE_PARM_DESC(mii_mode, "Enable HomePNA mode (bit 0),default=MII mode = 0");
 
@@ -286,7 +286,7 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
 {
        int i;
        __u8 data[4] = { phy, 0, 0, indx };
-       __u16 regdi;
+       __le16 regdi;
 
        set_register(pegasus, PhyCtrl, 0);
        set_registers(pegasus, PhyAddr, sizeof (data), data);
@@ -347,7 +347,7 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata)
 {
        int i;
        __u8 tmp;
-       __u16 retdatai;
+       __le16 retdatai;
 
        set_register(pegasus, EpromCtrl, 0);
        set_register(pegasus, EpromOffset, index);
@@ -417,7 +417,7 @@ static inline void get_node_id(pegasus_t * pegasus, __u8 * id)
 
        for (i = 0; i < 3; i++) {
                read_eprom_word(pegasus, i, &w16);
-               ((__u16 *) id)[i] = cpu_to_le16p(&w16);
+               ((__le16 *) id)[i] = cpu_to_le16p(&w16);
        }
 }
 
@@ -581,7 +581,7 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
        if (!count)
                goto goon;
 
-       rx_status = le32_to_cpu(*(int *) (urb->transfer_buffer + count - 4));
+       rx_status = le32_to_cpu(*(__le32 *) (urb->transfer_buffer + count - 4));
        if (rx_status & 0x000e0000) {
                dbg("%s: RX packet error %x", net->name, rx_status & 0xe0000);
                pegasus->stats.rx_errors++;
@@ -594,7 +594,7 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
                goto goon;
        }
        if (pegasus->chip == 0x8513) {
-               pkt_len = le32_to_cpu(*(int *)urb->transfer_buffer);
+               pkt_len = le32_to_cpu(*(__le32 *)urb->transfer_buffer);
                pkt_len &= 0x0fff;
                pegasus->rx_skb->data += 2;
        } else {
@@ -774,7 +774,7 @@ static int pegasus_start_xmit(struct sk_buff *skb, struct net_device *net)
 
        netif_stop_queue(net);
 
-       ((__u16 *) pegasus->tx_buff)[0] = cpu_to_le16(l16);
+       ((__le16 *) pegasus->tx_buff)[0] = cpu_to_le16(l16);
        memcpy(pegasus->tx_buff + 2, skb->data, skb->len);
        usb_fill_bulk_urb(pegasus->tx_urb, pegasus->usb,
                          usb_sndbulkpipe(pegasus->usb, 2),
@@ -1030,7 +1030,7 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void __user *uaddr)
        int cmd;
 
        pegasus = net->priv;
-       if (get_user(cmd, (int *) uaddr))
+       if (get_user(cmd, (int __user *) uaddr))
                return -EFAULT;
        switch (cmd) {
        case ETHTOOL_GDRVINFO:{
@@ -1107,13 +1107,13 @@ static int pegasus_ethtool_ioctl(struct net_device *net, void __user *uaddr)
 #endif
 static int pegasus_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
 {
-       __u16 *data = (__u16 *) & rq->ifr_data;
+       __u16 *data = (__u16 *) & rq->ifr_ifru;
        pegasus_t *pegasus = net->priv;
        int res;
 
        switch (cmd) {
        case SIOCETHTOOL:
-               res = pegasus_ethtool_ioctl(net, (void __user *)rq->ifr_data);
+               res = pegasus_ethtool_ioctl(net, rq->ifr_data);
                break;
        case SIOCDEVPRIVATE:
                data[0] = pegasus->phy;
@@ -1137,8 +1137,6 @@ static void pegasus_set_multicast(struct net_device *net)
 {
        pegasus_t *pegasus = net->priv;
 
-       netif_stop_queue(net);
-
        if (net->flags & IFF_PROMISC) {
                pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS;
                info("%s: Promiscuous mode enabled", net->name);
@@ -1154,8 +1152,6 @@ static void pegasus_set_multicast(struct net_device *net)
 
        pegasus->flags |= ETH_REGS_CHANGE;
        ctrl_callback(pegasus->ctrl_urb, NULL);
-
-       netif_wake_queue(net);
 }
 
 static __u8 mii_phy_probe(pegasus_t * pegasus)
@@ -1321,13 +1317,13 @@ static struct usb_driver pegasus_driver = {
        .id_table = pegasus_ids,
 };
 
-int __init pegasus_init(void)
+static int __init pegasus_init(void)
 {
        info(DRIVER_VERSION ":" DRIVER_DESC);
        return usb_register(&pegasus_driver);
 }
 
-void __exit pegasus_exit(void)
+static void __exit pegasus_exit(void)
 {
        usb_deregister(&pegasus_driver);
 }