aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
commit49e1900d4cc2e7bcecb681fe60f0990bec2dcce8 (patch)
tree253801ebf57e0a23856a2c7be129c2c178f62fdf /drivers/ieee1394
parent34f6d749c0a328817d5e36274e53121c1db734dc (diff)
parentb9099ff63c75216d6ca10bce5a1abcd9293c27e6 (diff)
Merge branch 'linux-2.6' into for-2.6.22
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r--drivers/ieee1394/eth1394.c4
-rw-r--r--drivers/ieee1394/eth1394.h2
-rw-r--r--drivers/ieee1394/nodemgr.c22
3 files changed, 9 insertions, 19 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index 03e44b337eb0..a364003ba47f 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -834,7 +834,7 @@ static inline u16 ether1394_type_trans(struct sk_buff *skb,
834 struct eth1394hdr *eth; 834 struct eth1394hdr *eth;
835 unsigned char *rawp; 835 unsigned char *rawp;
836 836
837 skb->mac.raw = skb->data; 837 skb_reset_mac_header(skb);
838 skb_pull (skb, ETH1394_HLEN); 838 skb_pull (skb, ETH1394_HLEN);
839 eth = eth1394_hdr(skb); 839 eth = eth1394_hdr(skb);
840 840
@@ -1668,7 +1668,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
1668 if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 || 1668 if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
1669 proto == htons(ETH_P_ARP) || 1669 proto == htons(ETH_P_ARP) ||
1670 (proto == htons(ETH_P_IP) && 1670 (proto == htons(ETH_P_IP) &&
1671 IN_MULTICAST(ntohl(skb->nh.iph->daddr)))) { 1671 IN_MULTICAST(ntohl(ip_hdr(skb)->daddr)))) {
1672 tx_type = ETH1394_GASP; 1672 tx_type = ETH1394_GASP;
1673 dest_node = LOCAL_BUS | ALL_NODES; 1673 dest_node = LOCAL_BUS | ALL_NODES;
1674 max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD; 1674 max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD;
diff --git a/drivers/ieee1394/eth1394.h b/drivers/ieee1394/eth1394.h
index c45cbff9138d..1e8356535149 100644
--- a/drivers/ieee1394/eth1394.h
+++ b/drivers/ieee1394/eth1394.h
@@ -90,7 +90,7 @@ struct eth1394hdr {
90 90
91static inline struct eth1394hdr *eth1394_hdr(const struct sk_buff *skb) 91static inline struct eth1394hdr *eth1394_hdr(const struct sk_buff *skb)
92{ 92{
93 return (struct eth1394hdr *)skb->mac.raw; 93 return (struct eth1394hdr *)skb_mac_header(skb);
94} 94}
95#endif 95#endif
96 96
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index c5ace190bfe6..dbeba45a031e 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -370,9 +370,7 @@ static ssize_t fw_set_ignore_driver(struct device *dev, struct device_attribute
370 370
371 if (state == 1) { 371 if (state == 1) {
372 ud->ignore_driver = 1; 372 ud->ignore_driver = 1;
373 down_write(&ieee1394_bus_type.subsys.rwsem);
374 device_release_driver(dev); 373 device_release_driver(dev);
375 up_write(&ieee1394_bus_type.subsys.rwsem);
376 } else if (state == 0) 374 } else if (state == 0)
377 ud->ignore_driver = 0; 375 ud->ignore_driver = 0;
378 376
@@ -1163,6 +1161,7 @@ static int nodemgr_uevent(struct class_device *cdev, char **envp, int num_envp,
1163 struct unit_directory *ud; 1161 struct unit_directory *ud;
1164 int i = 0; 1162 int i = 0;
1165 int length = 0; 1163 int length = 0;
1164 int retval = 0;
1166 /* ieee1394:venNmoNspNverN */ 1165 /* ieee1394:venNmoNspNverN */
1167 char buf[8 + 1 + 3 + 8 + 2 + 8 + 2 + 8 + 3 + 8 + 1]; 1166 char buf[8 + 1 + 3 + 8 + 2 + 8 + 2 + 8 + 3 + 8 + 1];
1168 1167
@@ -1176,14 +1175,11 @@ static int nodemgr_uevent(struct class_device *cdev, char **envp, int num_envp,
1176 1175
1177#define PUT_ENVP(fmt,val) \ 1176#define PUT_ENVP(fmt,val) \
1178do { \ 1177do { \
1179 int printed; \ 1178 retval = add_uevent_var(envp, num_envp, &i, \
1180 envp[i++] = buffer; \ 1179 buffer, buffer_size, &length, \
1181 printed = snprintf(buffer, buffer_size - length, \ 1180 fmt, val); \
1182 fmt, val); \ 1181 if (retval) \
1183 if ((buffer_size - (length+printed) <= 0) || (i >= num_envp)) \ 1182 return retval; \
1184 return -ENOMEM; \
1185 length += printed+1; \
1186 buffer += printed+1; \
1187} while (0) 1183} while (0)
1188 1184
1189 PUT_ENVP("VENDOR_ID=%06x", ud->vendor_id); 1185 PUT_ENVP("VENDOR_ID=%06x", ud->vendor_id);
@@ -1393,12 +1389,10 @@ static void nodemgr_suspend_ne(struct node_entry *ne)
1393 if (ud->ne != ne) 1389 if (ud->ne != ne)
1394 continue; 1390 continue;
1395 1391
1396 down_write(&ieee1394_bus_type.subsys.rwsem);
1397 if (ud->device.driver && 1392 if (ud->device.driver &&
1398 (!ud->device.driver->suspend || 1393 (!ud->device.driver->suspend ||
1399 ud->device.driver->suspend(&ud->device, PMSG_SUSPEND))) 1394 ud->device.driver->suspend(&ud->device, PMSG_SUSPEND)))
1400 device_release_driver(&ud->device); 1395 device_release_driver(&ud->device);
1401 up_write(&ieee1394_bus_type.subsys.rwsem);
1402 } 1396 }
1403 up(&nodemgr_ud_class.sem); 1397 up(&nodemgr_ud_class.sem);
1404} 1398}
@@ -1418,10 +1412,8 @@ static void nodemgr_resume_ne(struct node_entry *ne)
1418 if (ud->ne != ne) 1412 if (ud->ne != ne)
1419 continue; 1413 continue;
1420 1414
1421 down_read(&ieee1394_bus_type.subsys.rwsem);
1422 if (ud->device.driver && ud->device.driver->resume) 1415 if (ud->device.driver && ud->device.driver->resume)
1423 ud->device.driver->resume(&ud->device); 1416 ud->device.driver->resume(&ud->device);
1424 up_read(&ieee1394_bus_type.subsys.rwsem);
1425 } 1417 }
1426 up(&nodemgr_ud_class.sem); 1418 up(&nodemgr_ud_class.sem);
1427 1419
@@ -1442,7 +1434,6 @@ static void nodemgr_update_pdrv(struct node_entry *ne)
1442 if (ud->ne != ne) 1434 if (ud->ne != ne)
1443 continue; 1435 continue;
1444 1436
1445 down_write(&ieee1394_bus_type.subsys.rwsem);
1446 if (ud->device.driver) { 1437 if (ud->device.driver) {
1447 pdrv = container_of(ud->device.driver, 1438 pdrv = container_of(ud->device.driver,
1448 struct hpsb_protocol_driver, 1439 struct hpsb_protocol_driver,
@@ -1450,7 +1441,6 @@ static void nodemgr_update_pdrv(struct node_entry *ne)
1450 if (pdrv->update && pdrv->update(ud)) 1441 if (pdrv->update && pdrv->update(ud))
1451 device_release_driver(&ud->device); 1442 device_release_driver(&ud->device);
1452 } 1443 }
1453 up_write(&ieee1394_bus_type.subsys.rwsem);
1454 } 1444 }
1455 up(&nodemgr_ud_class.sem); 1445 up(&nodemgr_ud_class.sem);
1456} 1446}