drivers/video/msm: update to new kernel
[safe/jmp/linux-2.6] / drivers / net / ps3_gelic_net.c
index 2eb54fd..b211613 100644 (file)
@@ -214,9 +214,10 @@ static void gelic_card_free_chain(struct gelic_card *card,
  *
  * returns 0 on success, <0 on failure
  */
-static int gelic_card_init_chain(struct gelic_card *card,
-                                struct gelic_descr_chain *chain,
-                                struct gelic_descr *start_descr, int no)
+static int __devinit gelic_card_init_chain(struct gelic_card *card,
+                                          struct gelic_descr_chain *chain,
+                                          struct gelic_descr *start_descr,
+                                          int no)
 {
        int i;
        struct gelic_descr *descr;
@@ -407,7 +408,7 @@ rewind:
  *
  * returns 0 on success, < 0 on failure
  */
-static int gelic_card_alloc_rx_skbs(struct gelic_card *card)
+static int __devinit gelic_card_alloc_rx_skbs(struct gelic_card *card)
 {
        struct gelic_descr_chain *chain;
        int ret;
@@ -745,7 +746,7 @@ static inline struct sk_buff *gelic_put_vlan_tag(struct sk_buff *skb,
        /* Move the mac addresses to the top of buffer */
        memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN);
 
-       veth->h_vlan_proto = __constant_htons(ETH_P_8021Q);
+       veth->h_vlan_proto = cpu_to_be16(ETH_P_8021Q);
        veth->h_vlan_TCI = htons(tag);
 
        return skb;
@@ -1345,7 +1346,7 @@ done:
        return status;
 }
 
-static struct ethtool_ops gelic_ether_ethtool_ops = {
+static const struct ethtool_ops gelic_ether_ethtool_ops = {
        .get_drvinfo    = gelic_net_get_drvinfo,
        .get_settings   = gelic_ether_get_settings,
        .get_link       = ethtool_op_get_link,
@@ -1403,30 +1404,35 @@ void gelic_net_tx_timeout(struct net_device *netdev)
                atomic_dec(&card->tx_timeout_task_counter);
 }
 
+static const struct net_device_ops gelic_netdevice_ops = {
+       .ndo_open = gelic_net_open,
+       .ndo_stop = gelic_net_stop,
+       .ndo_start_xmit = gelic_net_xmit,
+       .ndo_set_multicast_list = gelic_net_set_multi,
+       .ndo_change_mtu = gelic_net_change_mtu,
+       .ndo_tx_timeout = gelic_net_tx_timeout,
+       .ndo_set_mac_address = eth_mac_addr,
+       .ndo_validate_addr = eth_validate_addr,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller = gelic_net_poll_controller,
+#endif
+};
+
 /**
  * gelic_ether_setup_netdev_ops - initialization of net_device operations
  * @netdev: net_device structure
  *
  * fills out function pointers in the net_device structure
  */
-static void gelic_ether_setup_netdev_ops(struct net_device *netdev,
-                                        struct napi_struct *napi)
+static void __devinit gelic_ether_setup_netdev_ops(struct net_device *netdev,
+                                                  struct napi_struct *napi)
 {
-       netdev->open = &gelic_net_open;
-       netdev->stop = &gelic_net_stop;
-       netdev->hard_start_xmit = &gelic_net_xmit;
-       netdev->set_multicast_list = &gelic_net_set_multi;
-       netdev->change_mtu = &gelic_net_change_mtu;
-       /* tx watchdog */
-       netdev->tx_timeout = &gelic_net_tx_timeout;
        netdev->watchdog_timeo = GELIC_NET_WATCHDOG_TIMEOUT;
        /* NAPI */
        netif_napi_add(netdev, napi,
                       gelic_net_poll, GELIC_NET_NAPI_WEIGHT);
        netdev->ethtool_ops = &gelic_ether_ethtool_ops;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       netdev->poll_controller = gelic_net_poll_controller;
-#endif
+       netdev->netdev_ops = &gelic_netdevice_ops;
 }
 
 /**
@@ -1439,11 +1445,11 @@ static void gelic_ether_setup_netdev_ops(struct net_device *netdev,
  * gelic_ether_setup_netdev initializes the net_device structure
  * and register it.
  **/
-int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card)
+int __devinit gelic_net_setup_netdev(struct net_device *netdev,
+                                    struct gelic_card *card)
 {
        int status;
        u64 v1, v2;
-       DECLARE_MAC_BUF(mac);
 
        netdev->features = NETIF_F_IP_CSUM;
 
@@ -1474,9 +1480,8 @@ int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card)
                        __func__, netdev->name, status);
                return status;
        }
-       dev_info(ctodev(card), "%s: MAC addr %s\n",
-                netdev->name,
-                print_mac(mac, netdev->dev_addr));
+       dev_info(ctodev(card), "%s: MAC addr %pM\n",
+                netdev->name, netdev->dev_addr);
 
        return 0;
 }
@@ -1489,7 +1494,7 @@ int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card)
  * the card and net_device structures are linked to each other
  */
 #define GELIC_ALIGN (32)
-static struct gelic_card *gelic_alloc_card_net(struct net_device **netdev)
+static struct gelic_card * __devinit gelic_alloc_card_net(struct net_device **netdev)
 {
        struct gelic_card *card;
        struct gelic_port *port;
@@ -1540,7 +1545,7 @@ static struct gelic_card *gelic_alloc_card_net(struct net_device **netdev)
        return card;
 }
 
-static void gelic_card_get_vlan_info(struct gelic_card *card)
+static void __devinit gelic_card_get_vlan_info(struct gelic_card *card)
 {
        u64 v1, v2;
        int status;
@@ -1614,7 +1619,7 @@ static void gelic_card_get_vlan_info(struct gelic_card *card)
 /**
  * ps3_gelic_driver_probe - add a device to the control of this driver
  */
-static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
+static int __devinit ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
 {
        struct gelic_card *card;
        struct net_device *netdev;
@@ -1646,7 +1651,7 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
                result = -ENOMEM;
                goto fail_alloc_card;
        }
-       ps3_system_bus_set_driver_data(dev, card);
+       ps3_system_bus_set_drvdata(dev, card);
        card->dev = dev;
 
        /* get internal vlan info */
@@ -1747,7 +1752,7 @@ fail_alloc_irq:
                                               bus_id(card),
                                               0, 0);
 fail_status_indicator:
-       ps3_system_bus_set_driver_data(dev, NULL);
+       ps3_system_bus_set_drvdata(dev, NULL);
        kfree(netdev_card(netdev)->unalign);
        free_netdev(netdev);
 fail_alloc_card:
@@ -1764,7 +1769,7 @@ fail_open:
 
 static int ps3_gelic_driver_remove(struct ps3_system_bus_device *dev)
 {
-       struct gelic_card *card = ps3_system_bus_get_driver_data(dev);
+       struct gelic_card *card = ps3_system_bus_get_drvdata(dev);
        struct net_device *netdev0;
        pr_debug("%s: called\n", __func__);
 
@@ -1801,7 +1806,7 @@ static int ps3_gelic_driver_remove(struct ps3_system_bus_device *dev)
        kfree(netdev_card(netdev0)->unalign);
        free_netdev(netdev0);
 
-       ps3_system_bus_set_driver_data(dev, NULL);
+       ps3_system_bus_set_drvdata(dev, NULL);
 
        ps3_dma_region_free(dev->d_region);