aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bmac.c13
-rw-r--r--drivers/net/ibmveth.c3
-rw-r--r--drivers/net/ibmveth.h27
-rw-r--r--drivers/net/mace.c2
-rw-r--r--drivers/net/spider_net.c12
-rw-r--r--drivers/net/sungem.c2
6 files changed, 33 insertions, 26 deletions
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index 6fad83f24c4f..711609665632 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -1264,7 +1264,8 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
1264{ 1264{
1265 int j, rev, ret; 1265 int j, rev, ret;
1266 struct bmac_data *bp; 1266 struct bmac_data *bp;
1267 unsigned char *addr; 1267 const unsigned char *prop_addr;
1268 unsigned char addr[6];
1268 struct net_device *dev; 1269 struct net_device *dev;
1269 int is_bmac_plus = ((int)match->data) != 0; 1270 int is_bmac_plus = ((int)match->data) != 0;
1270 1271
@@ -1272,14 +1273,16 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
1272 printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n"); 1273 printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n");
1273 return -ENODEV; 1274 return -ENODEV;
1274 } 1275 }
1275 addr = get_property(macio_get_of_node(mdev), "mac-address", NULL); 1276 prop_addr = get_property(macio_get_of_node(mdev), "mac-address", NULL);
1276 if (addr == NULL) { 1277 if (prop_addr == NULL) {
1277 addr = get_property(macio_get_of_node(mdev), "local-mac-address", NULL); 1278 prop_addr = get_property(macio_get_of_node(mdev),
1278 if (addr == NULL) { 1279 "local-mac-address", NULL);
1280 if (prop_addr == NULL) {
1279 printk(KERN_ERR "BMAC: Can't get mac-address\n"); 1281 printk(KERN_ERR "BMAC: Can't get mac-address\n");
1280 return -ENODEV; 1282 return -ENODEV;
1281 } 1283 }
1282 } 1284 }
1285 memcpy(addr, prop_addr, sizeof(addr));
1283 1286
1284 dev = alloc_etherdev(PRIV_BYTES); 1287 dev = alloc_etherdev(PRIV_BYTES);
1285 if (!dev) { 1288 if (!dev) {
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index 0464e78f733a..e56eac88b809 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -702,7 +702,8 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev)
702 desc[3].desc, 702 desc[3].desc,
703 desc[4].desc, 703 desc[4].desc,
704 desc[5].desc, 704 desc[5].desc,
705 correlator); 705 correlator,
706 &correlator);
706 } while ((lpar_rc == H_BUSY) && (retry_count--)); 707 } while ((lpar_rc == H_BUSY) && (retry_count--));
707 708
708 if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) { 709 if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) {
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h
index 8385bf836507..f5b25bff1540 100644
--- a/drivers/net/ibmveth.h
+++ b/drivers/net/ibmveth.h
@@ -41,16 +41,6 @@
41#define IbmVethMcastRemoveFilter 0x2UL 41#define IbmVethMcastRemoveFilter 0x2UL
42#define IbmVethMcastClearFilterTable 0x3UL 42#define IbmVethMcastClearFilterTable 0x3UL
43 43
44/* hcall numbers */
45#define H_VIO_SIGNAL 0x104
46#define H_REGISTER_LOGICAL_LAN 0x114
47#define H_FREE_LOGICAL_LAN 0x118
48#define H_ADD_LOGICAL_LAN_BUFFER 0x11C
49#define H_SEND_LOGICAL_LAN 0x120
50#define H_MULTICAST_CTRL 0x130
51#define H_CHANGE_LOGICAL_LAN_MAC 0x14C
52#define H_FREE_LOGICAL_LAN_BUFFER 0x1D4
53
54/* hcall macros */ 44/* hcall macros */
55#define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \ 45#define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \
56 plpar_hcall_norets(H_REGISTER_LOGICAL_LAN, ua, buflst, rxq, fltlst, mac) 46 plpar_hcall_norets(H_REGISTER_LOGICAL_LAN, ua, buflst, rxq, fltlst, mac)
@@ -61,8 +51,21 @@
61#define h_add_logical_lan_buffer(ua, buf) \ 51#define h_add_logical_lan_buffer(ua, buf) \
62 plpar_hcall_norets(H_ADD_LOGICAL_LAN_BUFFER, ua, buf) 52 plpar_hcall_norets(H_ADD_LOGICAL_LAN_BUFFER, ua, buf)
63 53
64#define h_send_logical_lan(ua, buf1, buf2, buf3, buf4, buf5, buf6, correlator) \ 54static inline long h_send_logical_lan(unsigned long unit_address,
65 plpar_hcall_8arg_2ret(H_SEND_LOGICAL_LAN, ua, buf1, buf2, buf3, buf4, buf5, buf6, correlator, &correlator) 55 unsigned long desc1, unsigned long desc2, unsigned long desc3,
56 unsigned long desc4, unsigned long desc5, unsigned long desc6,
57 unsigned long corellator_in, unsigned long *corellator_out)
58{
59 long rc;
60 unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
61
62 rc = plpar_hcall9(H_SEND_LOGICAL_LAN, retbuf, unit_address, desc1,
63 desc2, desc3, desc4, desc5, desc6, corellator_in);
64
65 *corellator_out = retbuf[0];
66
67 return rc;
68}
66 69
67#define h_multicast_ctrl(ua, cmd, mac) \ 70#define h_multicast_ctrl(ua, cmd, mac) \
68 plpar_hcall_norets(H_MULTICAST_CTRL, ua, cmd, mac) 71 plpar_hcall_norets(H_MULTICAST_CTRL, ua, cmd, mac)
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index 29e4b5aa6ead..5d80e0e6a8e9 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -113,7 +113,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
113 struct device_node *mace = macio_get_of_node(mdev); 113 struct device_node *mace = macio_get_of_node(mdev);
114 struct net_device *dev; 114 struct net_device *dev;
115 struct mace_data *mp; 115 struct mace_data *mp;
116 unsigned char *addr; 116 const unsigned char *addr;
117 int j, rev, rc = -EBUSY; 117 int j, rev, rc = -EBUSY;
118 118
119 if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { 119 if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) {
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 88907218457a..d64e718afbd2 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1697,10 +1697,10 @@ spider_net_setup_phy(struct spider_net_card *card)
1697 */ 1697 */
1698static int 1698static int
1699spider_net_download_firmware(struct spider_net_card *card, 1699spider_net_download_firmware(struct spider_net_card *card,
1700 u8 *firmware_ptr) 1700 const void *firmware_ptr)
1701{ 1701{
1702 int sequencer, i; 1702 int sequencer, i;
1703 u32 *fw_ptr = (u32 *)firmware_ptr; 1703 const u32 *fw_ptr = firmware_ptr;
1704 1704
1705 /* stop sequencers */ 1705 /* stop sequencers */
1706 spider_net_write_reg(card, SPIDER_NET_GSINIT, 1706 spider_net_write_reg(card, SPIDER_NET_GSINIT,
@@ -1757,7 +1757,7 @@ spider_net_init_firmware(struct spider_net_card *card)
1757{ 1757{
1758 struct firmware *firmware = NULL; 1758 struct firmware *firmware = NULL;
1759 struct device_node *dn; 1759 struct device_node *dn;
1760 u8 *fw_prop = NULL; 1760 const u8 *fw_prop = NULL;
1761 int err = -ENOENT; 1761 int err = -ENOENT;
1762 int fw_size; 1762 int fw_size;
1763 1763
@@ -1783,7 +1783,7 @@ try_host_fw:
1783 if (!dn) 1783 if (!dn)
1784 goto out_err; 1784 goto out_err;
1785 1785
1786 fw_prop = (u8 *)get_property(dn, "firmware", &fw_size); 1786 fw_prop = get_property(dn, "firmware", &fw_size);
1787 if (!fw_prop) 1787 if (!fw_prop)
1788 goto out_err; 1788 goto out_err;
1789 1789
@@ -1986,7 +1986,7 @@ spider_net_setup_netdev(struct spider_net_card *card)
1986 struct net_device *netdev = card->netdev; 1986 struct net_device *netdev = card->netdev;
1987 struct device_node *dn; 1987 struct device_node *dn;
1988 struct sockaddr addr; 1988 struct sockaddr addr;
1989 u8 *mac; 1989 const u8 *mac;
1990 1990
1991 SET_MODULE_OWNER(netdev); 1991 SET_MODULE_OWNER(netdev);
1992 SET_NETDEV_DEV(netdev, &card->pdev->dev); 1992 SET_NETDEV_DEV(netdev, &card->pdev->dev);
@@ -2019,7 +2019,7 @@ spider_net_setup_netdev(struct spider_net_card *card)
2019 if (!dn) 2019 if (!dn)
2020 return -EIO; 2020 return -EIO;
2021 2021
2022 mac = (u8 *)get_property(dn, "local-mac-address", NULL); 2022 mac = get_property(dn, "local-mac-address", NULL);
2023 if (!mac) 2023 if (!mac)
2024 return -EIO; 2024 return -EIO;
2025 memcpy(addr.sa_data, mac, ETH_ALEN); 2025 memcpy(addr.sa_data, mac, ETH_ALEN);
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index b70bbd748978..d7b1d1882cab 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2896,7 +2896,7 @@ static int __devinit gem_get_device_address(struct gem *gp)
2896 if (use_idprom) 2896 if (use_idprom)
2897 memcpy(dev->dev_addr, idprom->id_ethaddr, 6); 2897 memcpy(dev->dev_addr, idprom->id_ethaddr, 6);
2898#elif defined(CONFIG_PPC_PMAC) 2898#elif defined(CONFIG_PPC_PMAC)
2899 unsigned char *addr; 2899 const unsigned char *addr;
2900 2900
2901 addr = get_property(gp->of_node, "local-mac-address", NULL); 2901 addr = get_property(gp->of_node, "local-mac-address", NULL);
2902 if (addr == NULL) { 2902 if (addr == NULL) {