V4L/DVB: tm6000: README - add vbi
[safe/jmp/linux-2.6] / drivers / ieee1394 / eth1394.c
index 1a919df..a4e9dcb 100644 (file)
@@ -169,10 +169,11 @@ static int ether1394_header_cache(const struct neighbour *neigh,
 static void ether1394_header_cache_update(struct hh_cache *hh,
                                          const struct net_device *dev,
                                          const unsigned char *haddr);
-static int ether1394_tx(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t ether1394_tx(struct sk_buff *skb,
+                               struct net_device *dev);
 static void ether1394_iso(struct hpsb_iso *iso);
 
-static struct ethtool_ops ethtool_ops;
+static const struct ethtool_ops ethtool_ops;
 
 static int ether1394_write(struct hpsb_host *host, int srcid, int destid,
                           quadlet_t *data, u64 addr, size_t len, u16 flags);
@@ -181,7 +182,7 @@ static void ether1394_remove_host(struct hpsb_host *host);
 static void ether1394_host_reset(struct hpsb_host *host);
 
 /* Function for incoming 1394 packets */
-const static struct hpsb_address_ops addr_ops = {
+static const struct hpsb_address_ops addr_ops = {
        .write =        ether1394_write,
 };
 
@@ -361,7 +362,7 @@ static int eth1394_new_node(struct eth1394_host_info *hi,
        node_info->pdg.sz = 0;
        node_info->fifo = CSR1212_INVALID_ADDR_SPACE;
 
-       ud->device.driver_data = node_info;
+       dev_set_drvdata(&ud->device, node_info);
        new_node->ud = ud;
 
        priv = netdev_priv(hi->dev);
@@ -406,7 +407,7 @@ static int eth1394_remove(struct device *dev)
        list_del(&old_node->list);
        kfree(old_node);
 
-       node_info = (struct eth1394_node_info*)ud->device.driver_data;
+       node_info = dev_get_drvdata(&ud->device);
 
        spin_lock_irqsave(&node_info->pdg.lock, flags);
        /* The partial datagram list should be empty, but we'll just
@@ -416,7 +417,7 @@ static int eth1394_remove(struct device *dev)
        spin_unlock_irqrestore(&node_info->pdg.lock, flags);
 
        kfree(node_info);
-       ud->device.driver_data = NULL;
+       dev_set_drvdata(&ud->device, NULL);
        return 0;
 }
 
@@ -438,7 +439,7 @@ static int eth1394_update(struct unit_directory *ud)
        return eth1394_new_node(hi, ud);
 }
 
-static struct ieee1394_device_id eth1394_id_table[] = {
+static const struct ieee1394_device_id eth1394_id_table[] = {
        {
                .match_flags = (IEEE1394_MATCH_SPECIFIER_ID |
                                IEEE1394_MATCH_VERSION),
@@ -688,7 +689,7 @@ static void ether1394_host_reset(struct hpsb_host *host)
        ether1394_reset_priv(dev, 0);
 
        list_for_each_entry(node, &priv->ip_node_list, list) {
-               node_info = node->ud->device.driver_data;
+               node_info = dev_get_drvdata(&node->ud->device);
 
                spin_lock_irqsave(&node_info->pdg.lock, flags);
 
@@ -872,8 +873,7 @@ static __be16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev,
                if (!node)
                        return cpu_to_be16(0);
 
-               node_info =
-                   (struct eth1394_node_info *)node->ud->device.driver_data;
+               node_info = dev_get_drvdata(&node->ud->device);
 
                /* Update our speed/payload/fifo_offset table */
                node_info->maxpayload = maxpayload;
@@ -1080,7 +1080,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid,
                priv->ud_list[NODEID_TO_NODE(srcid)] = ud;
        }
 
-       node_info = (struct eth1394_node_info *)ud->device.driver_data;
+       node_info = dev_get_drvdata(&ud->device);
 
        /* First, did we receive a fragmented or unfragmented datagram? */
        hdr->words.word1 = ntohs(hdr->words.word1);
@@ -1301,7 +1301,6 @@ static void ether1394_iso(struct hpsb_iso *iso)
 
        hpsb_iso_recv_release_packets(iso, i);
 
-       dev->last_rx = jiffies;
 }
 
 /******************************************
@@ -1556,7 +1555,8 @@ static void ether1394_complete_cb(void *__ptask)
 }
 
 /* Transmit a packet (called by kernel) */
-static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t ether1394_tx(struct sk_buff *skb,
+                               struct net_device *dev)
 {
        struct eth1394hdr hdr_buf;
        struct eth1394_priv *priv = netdev_priv(dev);
@@ -1617,8 +1617,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
                if (!node)
                        goto fail;
 
-               node_info =
-                   (struct eth1394_node_info *)node->ud->device.driver_data;
+               node_info = dev_get_drvdata(&node->ud->device);
                if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE)
                        goto fail;
 
@@ -1696,14 +1695,6 @@ fail:
        dev->stats.tx_errors++;
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       /*
-        * FIXME: According to a patch from 2003-02-26, "returning non-zero
-        * causes serious problems" here, allegedly.  Before that patch,
-        * -ERRNO was returned which is not appropriate under Linux 2.6.
-        * Perhaps more needs to be done?  Stop the queue in serious
-        * conditions and restart it elsewhere?
-        */
-       /* return NETDEV_TX_BUSY; */
        return NETDEV_TX_OK;
 }
 
@@ -1714,7 +1705,7 @@ static void ether1394_get_drvinfo(struct net_device *dev,
        strcpy(info->bus_info, "ieee1394"); /* FIXME provide more detail? */
 }
 
-static struct ethtool_ops ethtool_ops = {
+static const struct ethtool_ops ethtool_ops = {
        .get_drvinfo = ether1394_get_drvinfo
 };