dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)
[safe/jmp/linux-2.6] / drivers / net / sb1000.c
index 829d0ea..fc0e38b 100644 (file)
@@ -134,6 +134,16 @@ static const struct pnp_device_id sb1000_pnp_ids[] = {
 };
 MODULE_DEVICE_TABLE(pnp, sb1000_pnp_ids);
 
+static const struct net_device_ops sb1000_netdev_ops = {
+       .ndo_open               = sb1000_open,
+       .ndo_start_xmit         = sb1000_start_xmit,
+       .ndo_do_ioctl           = sb1000_dev_ioctl,
+       .ndo_stop               = sb1000_close,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 static int
 sb1000_probe_one(struct pnp_dev *pdev, const struct pnp_device_id *id)
 {
@@ -192,11 +202,7 @@ sb1000_probe_one(struct pnp_dev *pdev, const struct pnp_device_id *id)
        if (sb1000_debug > 0)
                printk(KERN_NOTICE "%s", version);
 
-       /* The SB1000-specific entries in the device structure. */
-       dev->open               = sb1000_open;
-       dev->do_ioctl           = sb1000_dev_ioctl;
-       dev->hard_start_xmit    = sb1000_start_xmit;
-       dev->stop               = sb1000_close;
+       dev->netdev_ops = &sb1000_netdev_ops;
 
        /* hardware address is 0:0:serial_number */
        dev->dev_addr[2]        = serial_number >> 24 & 0xff;
@@ -437,7 +443,7 @@ sb1000_read_status(const int ioaddr[], unsigned char in[])
 static void
 sb1000_issue_read_command(const int ioaddr[], const char* name)
 {
-       const unsigned char Command0[6] = {0x20, 0x00, 0x00, 0x01, 0x00, 0x00};
+       static const unsigned char Command0[6] = {0x20, 0x00, 0x00, 0x01, 0x00, 0x00};
 
        sb1000_wait_for_ready_clear(ioaddr, name);
        outb(0xa0, ioaddr[0] + 6);
@@ -453,9 +459,10 @@ sb1000_issue_read_command(const int ioaddr[], const char* name)
 static int
 sb1000_reset(const int ioaddr[], const char* name)
 {
+       static const unsigned char Command0[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00};
+
        unsigned char st[7];
        int port, status;
-       const unsigned char Command0[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00};
 
        port = ioaddr[1] + 6;
        outb(0x4, port);
@@ -482,9 +489,10 @@ sb1000_reset(const int ioaddr[], const char* name)
 static int
 sb1000_check_CRC(const int ioaddr[], const char* name)
 {
+       static const unsigned char Command0[6] = {0x80, 0x1f, 0x00, 0x00, 0x00, 0x00};
+
        unsigned char st[7];
        int crc, status;
-       const unsigned char Command0[6] = {0x80, 0x1f, 0x00, 0x00, 0x00, 0x00};
 
        /* check CRC */
        if ((status = card_send_command(ioaddr, name, Command0, st)))
@@ -498,8 +506,9 @@ sb1000_check_CRC(const int ioaddr[], const char* name)
 static inline int
 sb1000_start_get_set_command(const int ioaddr[], const char* name)
 {
+       static const unsigned char Command0[6] = {0x80, 0x1b, 0x00, 0x00, 0x00, 0x00};
+
        unsigned char st[7];
-       const unsigned char Command0[6] = {0x80, 0x1b, 0x00, 0x00, 0x00, 0x00};
 
        return card_send_command(ioaddr, name, Command0, st);
 }
@@ -507,10 +516,11 @@ sb1000_start_get_set_command(const int ioaddr[], const char* name)
 static int
 sb1000_end_get_set_command(const int ioaddr[], const char* name)
 {
+       static const unsigned char Command0[6] = {0x80, 0x1b, 0x02, 0x00, 0x00, 0x00};
+       static const unsigned char Command1[6] = {0x20, 0x00, 0x00, 0x00, 0x00, 0x00};
+
        unsigned char st[7];
        int status;
-       const unsigned char Command0[6] = {0x80, 0x1b, 0x02, 0x00, 0x00, 0x00};
-       const unsigned char Command1[6] = {0x20, 0x00, 0x00, 0x00, 0x00, 0x00};
 
        if ((status = card_send_command(ioaddr, name, Command0, st)))
                return status;
@@ -520,10 +530,11 @@ sb1000_end_get_set_command(const int ioaddr[], const char* name)
 static int
 sb1000_activate(const int ioaddr[], const char* name)
 {
+       static const unsigned char Command0[6] = {0x80, 0x11, 0x00, 0x00, 0x00, 0x00};
+       static const unsigned char Command1[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00};
+
        unsigned char st[7];
        int status;
-       const unsigned char Command0[6] = {0x80, 0x11, 0x00, 0x00, 0x00, 0x00};
-       const unsigned char Command1[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00};
 
        ssleep(1);
        if ((status = card_send_command(ioaddr, name, Command0, st)))
@@ -544,9 +555,10 @@ static int
 sb1000_get_firmware_version(const int ioaddr[], const char* name,
        unsigned char version[], int do_end)
 {
+       static const unsigned char Command0[6] = {0x80, 0x23, 0x00, 0x00, 0x00, 0x00};
+
        unsigned char st[7];
        int status;
-       const unsigned char Command0[6] = {0x80, 0x23, 0x00, 0x00, 0x00, 0x00};
 
        if ((status = sb1000_start_get_set_command(ioaddr, name)))
                return status;
@@ -566,9 +578,10 @@ sb1000_get_firmware_version(const int ioaddr[], const char* name,
 static int
 sb1000_get_frequency(const int ioaddr[], const char* name, int* frequency)
 {
+       static const unsigned char Command0[6] = {0x80, 0x44, 0x00, 0x00, 0x00, 0x00};
+
        unsigned char st[7];
        int status;
-       const unsigned char Command0[6] = {0x80, 0x44, 0x00, 0x00, 0x00, 0x00};
 
        udelay(1000);
        if ((status = sb1000_start_get_set_command(ioaddr, name)))
@@ -613,12 +626,13 @@ sb1000_set_frequency(const int ioaddr[], const char* name, int frequency)
 static int
 sb1000_get_PIDs(const int ioaddr[], const char* name, short PID[])
 {
+       static const unsigned char Command0[6] = {0x80, 0x40, 0x00, 0x00, 0x00, 0x00};
+       static const unsigned char Command1[6] = {0x80, 0x41, 0x00, 0x00, 0x00, 0x00};
+       static const unsigned char Command2[6] = {0x80, 0x42, 0x00, 0x00, 0x00, 0x00};
+       static const unsigned char Command3[6] = {0x80, 0x43, 0x00, 0x00, 0x00, 0x00};
+
        unsigned char st[7];
        int status;
-       const unsigned char Command0[6] = {0x80, 0x40, 0x00, 0x00, 0x00, 0x00};
-       const unsigned char Command1[6] = {0x80, 0x41, 0x00, 0x00, 0x00, 0x00};
-       const unsigned char Command2[6] = {0x80, 0x42, 0x00, 0x00, 0x00, 0x00};
-       const unsigned char Command3[6] = {0x80, 0x43, 0x00, 0x00, 0x00, 0x00};
 
        udelay(1000);
        if ((status = sb1000_start_get_set_command(ioaddr, name)))
@@ -647,6 +661,8 @@ sb1000_get_PIDs(const int ioaddr[], const char* name, short PID[])
 static int
 sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[])
 {
+       static const unsigned char Command4[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00};
+
        unsigned char st[7];
        short p;
        int status;
@@ -654,7 +670,6 @@ sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[])
        unsigned char Command1[6] = {0x80, 0x32, 0x00, 0x00, 0x00, 0x00};
        unsigned char Command2[6] = {0x80, 0x33, 0x00, 0x00, 0x00, 0x00};
        unsigned char Command3[6] = {0x80, 0x34, 0x00, 0x00, 0x00, 0x00};
-       const unsigned char Command4[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00};
 
        udelay(1000);
        if ((status = sb1000_start_get_set_command(ioaddr, name)))
@@ -860,7 +875,6 @@ printk("cm0: IP identification: %02x%02x  fragment offset: %02x%02x\n", buffer[3
        /* datagram completed: send to upper level */
        skb_trim(skb, dlen);
        netif_rx(skb);
-       dev->last_rx = jiffies;
        stats->rx_bytes+=dlen;
        stats->rx_packets++;
        lp->rx_skb[ns] = NULL;
@@ -891,11 +905,12 @@ dropped_frame:
 static void
 sb1000_error_dpc(struct net_device *dev)
 {
+       static const unsigned char Command0[6] = {0x80, 0x26, 0x00, 0x00, 0x00, 0x00};
+
        char *name;
        unsigned char st[5];
        int ioaddr[2];
        struct sb1000_private *lp = netdev_priv(dev);
-       const unsigned char Command0[6] = {0x80, 0x26, 0x00, 0x00, 0x00, 0x00};
        const int ErrorDpcCounterInitialize = 200;
 
        ioaddr[0] = dev->base_addr;
@@ -1077,14 +1092,15 @@ sb1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
 /* SB1000 interrupt handler. */
 static irqreturn_t sb1000_interrupt(int irq, void *dev_id)
 {
+       static const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00};
+       static const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00};
+
        char *name;
        unsigned char st;
        int ioaddr[2];
        struct net_device *dev = dev_id;
        struct sb1000_private *lp = netdev_priv(dev);
 
-       const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00};
-       const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00};
        const int MaxRxErrorCount = 6;
 
        ioaddr[0] = dev->base_addr;