diff options
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r-- | drivers/ieee1394/amdtp.c | 1 | ||||
-rw-r--r-- | drivers/ieee1394/csr1212.h | 1 | ||||
-rw-r--r-- | drivers/ieee1394/dv1394.c | 1 | ||||
-rw-r--r-- | drivers/ieee1394/eth1394.c | 12 | ||||
-rw-r--r-- | drivers/ieee1394/eth1394.h | 6 | ||||
-rw-r--r-- | drivers/ieee1394/hosts.c | 3 | ||||
-rw-r--r-- | drivers/ieee1394/hosts.h | 8 | ||||
-rw-r--r-- | drivers/ieee1394/ieee1394_core.c | 32 | ||||
-rw-r--r-- | drivers/ieee1394/nodemgr.c | 23 | ||||
-rw-r--r-- | drivers/ieee1394/ohci1394.c | 4 | ||||
-rw-r--r-- | drivers/ieee1394/raw1394.c | 1 | ||||
-rw-r--r-- | drivers/ieee1394/sbp2.c | 107 | ||||
-rw-r--r-- | drivers/ieee1394/video1394.c | 1 |
13 files changed, 105 insertions, 95 deletions
diff --git a/drivers/ieee1394/amdtp.c b/drivers/ieee1394/amdtp.c index 84ae027b021a..e8e28569a668 100644 --- a/drivers/ieee1394/amdtp.c +++ b/drivers/ieee1394/amdtp.c | |||
@@ -1297,4 +1297,3 @@ static void __exit amdtp_exit_module (void) | |||
1297 | 1297 | ||
1298 | module_init(amdtp_init_module); | 1298 | module_init(amdtp_init_module); |
1299 | module_exit(amdtp_exit_module); | 1299 | module_exit(amdtp_exit_module); |
1300 | MODULE_ALIAS_CHARDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_AMDTP * 16); | ||
diff --git a/drivers/ieee1394/csr1212.h b/drivers/ieee1394/csr1212.h index e6734263a1d3..28c5f4b726e2 100644 --- a/drivers/ieee1394/csr1212.h +++ b/drivers/ieee1394/csr1212.h | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/types.h> | 37 | #include <linux/types.h> |
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | #include <linux/interrupt.h> | 39 | #include <linux/interrupt.h> |
40 | #include <linux/sched.h> | ||
41 | #include <linux/vmalloc.h> | 40 | #include <linux/vmalloc.h> |
42 | #include <asm/pgalloc.h> | 41 | #include <asm/pgalloc.h> |
43 | 42 | ||
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c index 4538b0235ca3..e34730c7a874 100644 --- a/drivers/ieee1394/dv1394.c +++ b/drivers/ieee1394/dv1394.c | |||
@@ -2660,4 +2660,3 @@ static int __init dv1394_init_module(void) | |||
2660 | 2660 | ||
2661 | module_init(dv1394_init_module); | 2661 | module_init(dv1394_init_module); |
2662 | module_exit(dv1394_exit_module); | 2662 | module_exit(dv1394_exit_module); |
2663 | MODULE_ALIAS_CHARDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16); | ||
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index cd53c174ced1..4802bbbb6dc9 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -89,7 +89,7 @@ | |||
89 | #define TRACE() printk(KERN_ERR "%s:%s[%d] ---- TRACE\n", driver_name, __FUNCTION__, __LINE__) | 89 | #define TRACE() printk(KERN_ERR "%s:%s[%d] ---- TRACE\n", driver_name, __FUNCTION__, __LINE__) |
90 | 90 | ||
91 | static char version[] __devinitdata = | 91 | static char version[] __devinitdata = |
92 | "$Rev: 1264 $ Ben Collins <bcollins@debian.org>"; | 92 | "$Rev: 1312 $ Ben Collins <bcollins@debian.org>"; |
93 | 93 | ||
94 | struct fragment_info { | 94 | struct fragment_info { |
95 | struct list_head list; | 95 | struct list_head list; |
@@ -221,9 +221,7 @@ static int ether1394_open (struct net_device *dev) | |||
221 | if (priv->bc_state == ETHER1394_BC_ERROR) { | 221 | if (priv->bc_state == ETHER1394_BC_ERROR) { |
222 | /* we'll try again */ | 222 | /* we'll try again */ |
223 | priv->iso = hpsb_iso_recv_init(priv->host, | 223 | priv->iso = hpsb_iso_recv_init(priv->host, |
224 | ETHER1394_GASP_BUFFERS * 2 * | 224 | ETHER1394_ISO_BUF_SIZE, |
225 | (1 << (priv->host->csr.max_rec + | ||
226 | 1)), | ||
227 | ETHER1394_GASP_BUFFERS, | 225 | ETHER1394_GASP_BUFFERS, |
228 | priv->broadcast_channel, | 226 | priv->broadcast_channel, |
229 | HPSB_ISO_DMA_PACKET_PER_BUFFER, | 227 | HPSB_ISO_DMA_PACKET_PER_BUFFER, |
@@ -635,8 +633,8 @@ static void ether1394_add_host (struct hpsb_host *host) | |||
635 | * be checked when the eth device is opened. */ | 633 | * be checked when the eth device is opened. */ |
636 | priv->broadcast_channel = host->csr.broadcast_channel & 0x3f; | 634 | priv->broadcast_channel = host->csr.broadcast_channel & 0x3f; |
637 | 635 | ||
638 | priv->iso = hpsb_iso_recv_init(host, (ETHER1394_GASP_BUFFERS * 2 * | 636 | priv->iso = hpsb_iso_recv_init(host, |
639 | (1 << (host->csr.max_rec + 1))), | 637 | ETHER1394_ISO_BUF_SIZE, |
640 | ETHER1394_GASP_BUFFERS, | 638 | ETHER1394_GASP_BUFFERS, |
641 | priv->broadcast_channel, | 639 | priv->broadcast_channel, |
642 | HPSB_ISO_DMA_PACKET_PER_BUFFER, | 640 | HPSB_ISO_DMA_PACKET_PER_BUFFER, |
@@ -1770,7 +1768,7 @@ fail: | |||
1770 | static void ether1394_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | 1768 | static void ether1394_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) |
1771 | { | 1769 | { |
1772 | strcpy (info->driver, driver_name); | 1770 | strcpy (info->driver, driver_name); |
1773 | strcpy (info->version, "$Rev: 1264 $"); | 1771 | strcpy (info->version, "$Rev: 1312 $"); |
1774 | /* FIXME XXX provide sane businfo */ | 1772 | /* FIXME XXX provide sane businfo */ |
1775 | strcpy (info->bus_info, "ieee1394"); | 1773 | strcpy (info->bus_info, "ieee1394"); |
1776 | } | 1774 | } |
diff --git a/drivers/ieee1394/eth1394.h b/drivers/ieee1394/eth1394.h index ed8f1c4b7fd8..a77213cfc483 100644 --- a/drivers/ieee1394/eth1394.h +++ b/drivers/ieee1394/eth1394.h | |||
@@ -44,6 +44,12 @@ | |||
44 | 44 | ||
45 | #define ETHER1394_GASP_BUFFERS 16 | 45 | #define ETHER1394_GASP_BUFFERS 16 |
46 | 46 | ||
47 | /* rawiso buffer size - due to a limitation in rawiso, we must limit each | ||
48 | * GASP buffer to be less than PAGE_SIZE. */ | ||
49 | #define ETHER1394_ISO_BUF_SIZE ETHER1394_GASP_BUFFERS * \ | ||
50 | min((unsigned int)PAGE_SIZE, \ | ||
51 | 2 * (1U << (priv->host->csr.max_rec + 1))) | ||
52 | |||
47 | /* Node set == 64 */ | 53 | /* Node set == 64 */ |
48 | #define NODE_SET (ALL_NODES + 1) | 54 | #define NODE_SET (ALL_NODES + 1) |
49 | 55 | ||
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c index c502c6e9c440..aeeaeb670d03 100644 --- a/drivers/ieee1394/hosts.c +++ b/drivers/ieee1394/hosts.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
20 | #include <linux/timer.h> | 20 | #include <linux/timer.h> |
21 | #include <linux/jiffies.h> | ||
21 | 22 | ||
22 | #include "csr1212.h" | 23 | #include "csr1212.h" |
23 | #include "ieee1394.h" | 24 | #include "ieee1394.h" |
@@ -217,7 +218,7 @@ int hpsb_update_config_rom_image(struct hpsb_host *host) | |||
217 | 218 | ||
218 | /* IEEE 1394a-2000 prohibits using the same generation number | 219 | /* IEEE 1394a-2000 prohibits using the same generation number |
219 | * twice in a 60 second period. */ | 220 | * twice in a 60 second period. */ |
220 | if (jiffies - host->csr.gen_timestamp[next_gen] < 60 * HZ) | 221 | if (time_before(jiffies, host->csr.gen_timestamp[next_gen] + 60 * HZ)) |
221 | /* Wait 60 seconds from the last time this generation number was | 222 | /* Wait 60 seconds from the last time this generation number was |
222 | * used. */ | 223 | * used. */ |
223 | reset_delay = (60 * HZ) + host->csr.gen_timestamp[next_gen] - jiffies; | 224 | reset_delay = (60 * HZ) + host->csr.gen_timestamp[next_gen] - jiffies; |
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h index 739e76840d51..38f42112dff0 100644 --- a/drivers/ieee1394/hosts.h +++ b/drivers/ieee1394/hosts.h | |||
@@ -135,17 +135,17 @@ enum isoctl_cmd { | |||
135 | 135 | ||
136 | enum reset_types { | 136 | enum reset_types { |
137 | /* 166 microsecond reset -- only type of reset available on | 137 | /* 166 microsecond reset -- only type of reset available on |
138 | non-1394a capable IEEE 1394 controllers */ | 138 | non-1394a capable controllers */ |
139 | LONG_RESET, | 139 | LONG_RESET, |
140 | 140 | ||
141 | /* Short (arbitrated) reset -- only available on 1394a capable | 141 | /* Short (arbitrated) reset -- only available on 1394a capable |
142 | IEEE 1394 capable controllers */ | 142 | controllers */ |
143 | SHORT_RESET, | 143 | SHORT_RESET, |
144 | 144 | ||
145 | /* Variants, that set force_root before issueing the bus reset */ | 145 | /* Variants that set force_root before issueing the bus reset */ |
146 | LONG_RESET_FORCE_ROOT, SHORT_RESET_FORCE_ROOT, | 146 | LONG_RESET_FORCE_ROOT, SHORT_RESET_FORCE_ROOT, |
147 | 147 | ||
148 | /* Variants, that clear force_root before issueing the bus reset */ | 148 | /* Variants that clear force_root before issueing the bus reset */ |
149 | LONG_RESET_NO_FORCE_ROOT, SHORT_RESET_NO_FORCE_ROOT | 149 | LONG_RESET_NO_FORCE_ROOT, SHORT_RESET_NO_FORCE_ROOT |
150 | }; | 150 | }; |
151 | 151 | ||
diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c index d633770fac8e..32a1e016c85e 100644 --- a/drivers/ieee1394/ieee1394_core.c +++ b/drivers/ieee1394/ieee1394_core.c | |||
@@ -70,7 +70,7 @@ const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S32 | |||
70 | struct class *hpsb_protocol_class; | 70 | struct class *hpsb_protocol_class; |
71 | 71 | ||
72 | #ifdef CONFIG_IEEE1394_VERBOSEDEBUG | 72 | #ifdef CONFIG_IEEE1394_VERBOSEDEBUG |
73 | static void dump_packet(const char *text, quadlet_t *data, int size) | 73 | static void dump_packet(const char *text, quadlet_t *data, int size, int speed) |
74 | { | 74 | { |
75 | int i; | 75 | int i; |
76 | 76 | ||
@@ -78,12 +78,15 @@ static void dump_packet(const char *text, quadlet_t *data, int size) | |||
78 | size = (size > 4 ? 4 : size); | 78 | size = (size > 4 ? 4 : size); |
79 | 79 | ||
80 | printk(KERN_DEBUG "ieee1394: %s", text); | 80 | printk(KERN_DEBUG "ieee1394: %s", text); |
81 | if (speed > -1 && speed < 6) | ||
82 | printk(" at %s", hpsb_speedto_str[speed]); | ||
83 | printk(":"); | ||
81 | for (i = 0; i < size; i++) | 84 | for (i = 0; i < size; i++) |
82 | printk(" %08x", data[i]); | 85 | printk(" %08x", data[i]); |
83 | printk("\n"); | 86 | printk("\n"); |
84 | } | 87 | } |
85 | #else | 88 | #else |
86 | #define dump_packet(x,y,z) | 89 | #define dump_packet(a,b,c,d) |
87 | #endif | 90 | #endif |
88 | 91 | ||
89 | static void abort_requests(struct hpsb_host *host); | 92 | static void abort_requests(struct hpsb_host *host); |
@@ -544,8 +547,7 @@ int hpsb_send_packet(struct hpsb_packet *packet) | |||
544 | if (packet->data_size) | 547 | if (packet->data_size) |
545 | memcpy(((u8*)data) + packet->header_size, packet->data, packet->data_size); | 548 | memcpy(((u8*)data) + packet->header_size, packet->data, packet->data_size); |
546 | 549 | ||
547 | dump_packet("send packet local:", packet->header, | 550 | dump_packet("send packet local", packet->header, packet->header_size, -1); |
548 | packet->header_size); | ||
549 | 551 | ||
550 | hpsb_packet_sent(host, packet, packet->expect_response ? ACK_PENDING : ACK_COMPLETE); | 552 | hpsb_packet_sent(host, packet, packet->expect_response ? ACK_PENDING : ACK_COMPLETE); |
551 | hpsb_packet_received(host, data, size, 0); | 553 | hpsb_packet_received(host, data, size, 0); |
@@ -561,21 +563,7 @@ int hpsb_send_packet(struct hpsb_packet *packet) | |||
561 | + NODEID_TO_NODE(packet->node_id)]; | 563 | + NODEID_TO_NODE(packet->node_id)]; |
562 | } | 564 | } |
563 | 565 | ||
564 | #ifdef CONFIG_IEEE1394_VERBOSEDEBUG | 566 | dump_packet("send packet", packet->header, packet->header_size, packet->speed_code); |
565 | switch (packet->speed_code) { | ||
566 | case 2: | ||
567 | dump_packet("send packet 400:", packet->header, | ||
568 | packet->header_size); | ||
569 | break; | ||
570 | case 1: | ||
571 | dump_packet("send packet 200:", packet->header, | ||
572 | packet->header_size); | ||
573 | break; | ||
574 | default: | ||
575 | dump_packet("send packet 100:", packet->header, | ||
576 | packet->header_size); | ||
577 | } | ||
578 | #endif | ||
579 | 567 | ||
580 | return host->driver->transmit_packet(host, packet); | 568 | return host->driver->transmit_packet(host, packet); |
581 | } | 569 | } |
@@ -636,7 +624,7 @@ static void handle_packet_response(struct hpsb_host *host, int tcode, | |||
636 | 624 | ||
637 | if (packet == NULL) { | 625 | if (packet == NULL) { |
638 | HPSB_DEBUG("unsolicited response packet received - no tlabel match"); | 626 | HPSB_DEBUG("unsolicited response packet received - no tlabel match"); |
639 | dump_packet("contents:", data, 16); | 627 | dump_packet("contents", data, 16, -1); |
640 | spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags); | 628 | spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags); |
641 | return; | 629 | return; |
642 | } | 630 | } |
@@ -677,7 +665,7 @@ static void handle_packet_response(struct hpsb_host *host, int tcode, | |||
677 | if (!tcode_match) { | 665 | if (!tcode_match) { |
678 | spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags); | 666 | spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags); |
679 | HPSB_INFO("unsolicited response packet received - tcode mismatch"); | 667 | HPSB_INFO("unsolicited response packet received - tcode mismatch"); |
680 | dump_packet("contents:", data, 16); | 668 | dump_packet("contents", data, 16, -1); |
681 | return; | 669 | return; |
682 | } | 670 | } |
683 | 671 | ||
@@ -914,7 +902,7 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size, | |||
914 | return; | 902 | return; |
915 | } | 903 | } |
916 | 904 | ||
917 | dump_packet("received packet:", data, size); | 905 | dump_packet("received packet", data, size, -1); |
918 | 906 | ||
919 | tcode = (data[0] >> 4) & 0xf; | 907 | tcode = (data[0] >> 4) & 0xf; |
920 | 908 | ||
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index b23322523ef5..347ece6b583c 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c | |||
@@ -64,10 +64,10 @@ static int nodemgr_bus_read(struct csr1212_csr *csr, u64 addr, u16 length, | |||
64 | struct nodemgr_csr_info *ci = (struct nodemgr_csr_info*)__ci; | 64 | struct nodemgr_csr_info *ci = (struct nodemgr_csr_info*)__ci; |
65 | int i, ret = 0; | 65 | int i, ret = 0; |
66 | 66 | ||
67 | for (i = 0; i < 3; i++) { | 67 | for (i = 1; ; i++) { |
68 | ret = hpsb_read(ci->host, ci->nodeid, ci->generation, addr, | 68 | ret = hpsb_read(ci->host, ci->nodeid, ci->generation, addr, |
69 | buffer, length); | 69 | buffer, length); |
70 | if (!ret) | 70 | if (!ret || i == 3) |
71 | break; | 71 | break; |
72 | 72 | ||
73 | if (msleep_interruptible(334)) | 73 | if (msleep_interruptible(334)) |
@@ -1438,9 +1438,13 @@ static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles) | |||
1438 | if (host->busmgr_id == 0xffff && host->node_count > 1) | 1438 | if (host->busmgr_id == 0xffff && host->node_count > 1) |
1439 | { | 1439 | { |
1440 | u16 root_node = host->node_count - 1; | 1440 | u16 root_node = host->node_count - 1; |
1441 | struct node_entry *ne = find_entry_by_nodeid(host, root_node | LOCAL_BUS); | ||
1442 | 1441 | ||
1443 | if (ne && ne->busopt.cmc) | 1442 | /* get cycle master capability flag from root node */ |
1443 | if (host->is_cycmst || | ||
1444 | (!hpsb_read(host, LOCAL_BUS | root_node, get_hpsb_generation(host), | ||
1445 | (CSR_REGISTER_BASE + CSR_CONFIG_ROM + 2 * sizeof(quadlet_t)), | ||
1446 | &bc, sizeof(quadlet_t)) && | ||
1447 | be32_to_cpu(bc) & 1 << CSR_CMC_SHIFT)) | ||
1444 | hpsb_send_phy_config(host, root_node, -1); | 1448 | hpsb_send_phy_config(host, root_node, -1); |
1445 | else { | 1449 | else { |
1446 | HPSB_DEBUG("The root node is not cycle master capable; " | 1450 | HPSB_DEBUG("The root node is not cycle master capable; " |
@@ -1557,24 +1561,19 @@ static int nodemgr_host_thread(void *__hi) | |||
1557 | } | 1561 | } |
1558 | } | 1562 | } |
1559 | 1563 | ||
1560 | if (!nodemgr_check_irm_capability(host, reset_cycles)) { | 1564 | if (!nodemgr_check_irm_capability(host, reset_cycles) || |
1565 | !nodemgr_do_irm_duties(host, reset_cycles)) { | ||
1561 | reset_cycles++; | 1566 | reset_cycles++; |
1562 | up(&nodemgr_serialize); | 1567 | up(&nodemgr_serialize); |
1563 | continue; | 1568 | continue; |
1564 | } | 1569 | } |
1570 | reset_cycles = 0; | ||
1565 | 1571 | ||
1566 | /* Scan our nodes to get the bus options and create node | 1572 | /* Scan our nodes to get the bus options and create node |
1567 | * entries. This does not do the sysfs stuff, since that | 1573 | * entries. This does not do the sysfs stuff, since that |
1568 | * would trigger hotplug callbacks and such, which is a | 1574 | * would trigger hotplug callbacks and such, which is a |
1569 | * bad idea at this point. */ | 1575 | * bad idea at this point. */ |
1570 | nodemgr_node_scan(hi, generation); | 1576 | nodemgr_node_scan(hi, generation); |
1571 | if (!nodemgr_do_irm_duties(host, reset_cycles)) { | ||
1572 | reset_cycles++; | ||
1573 | up(&nodemgr_serialize); | ||
1574 | continue; | ||
1575 | } | ||
1576 | |||
1577 | reset_cycles = 0; | ||
1578 | 1577 | ||
1579 | /* This actually does the full probe, with sysfs | 1578 | /* This actually does the full probe, with sysfs |
1580 | * registration. */ | 1579 | * registration. */ |
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index 27018c8efc24..6a6acbd80af4 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c | |||
@@ -162,7 +162,7 @@ printk(level "%s: " fmt "\n" , OHCI1394_DRIVER_NAME , ## args) | |||
162 | printk(level "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, ohci->host->id , ## args) | 162 | printk(level "%s: fw-host%d: " fmt "\n" , OHCI1394_DRIVER_NAME, ohci->host->id , ## args) |
163 | 163 | ||
164 | static char version[] __devinitdata = | 164 | static char version[] __devinitdata = |
165 | "$Rev: 1299 $ Ben Collins <bcollins@debian.org>"; | 165 | "$Rev: 1313 $ Ben Collins <bcollins@debian.org>"; |
166 | 166 | ||
167 | /* Module Parameters */ | 167 | /* Module Parameters */ |
168 | static int phys_dma = 1; | 168 | static int phys_dma = 1; |
@@ -1084,7 +1084,7 @@ static int ohci_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg) | |||
1084 | initialize_dma_rcv_ctx(&ohci->ir_legacy_context, 1); | 1084 | initialize_dma_rcv_ctx(&ohci->ir_legacy_context, 1); |
1085 | 1085 | ||
1086 | if (printk_ratelimit()) | 1086 | if (printk_ratelimit()) |
1087 | PRINT(KERN_ERR, "IR legacy activated"); | 1087 | DBGMSG("IR legacy activated"); |
1088 | } | 1088 | } |
1089 | 1089 | ||
1090 | spin_lock_irqsave(&ohci->IR_channel_lock, flags); | 1090 | spin_lock_irqsave(&ohci->IR_channel_lock, flags); |
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c index b4fa14793fe5..5fe4f2ba0979 100644 --- a/drivers/ieee1394/raw1394.c +++ b/drivers/ieee1394/raw1394.c | |||
@@ -2958,4 +2958,3 @@ static void __exit cleanup_raw1394(void) | |||
2958 | module_init(init_raw1394); | 2958 | module_init(init_raw1394); |
2959 | module_exit(cleanup_raw1394); | 2959 | module_exit(cleanup_raw1394); |
2960 | MODULE_LICENSE("GPL"); | 2960 | MODULE_LICENSE("GPL"); |
2961 | MODULE_ALIAS_CHARDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16); | ||
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index de88218ef7cc..12cec7c4a342 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -97,16 +97,18 @@ static char version[] __devinitdata = | |||
97 | */ | 97 | */ |
98 | static int max_speed = IEEE1394_SPEED_MAX; | 98 | static int max_speed = IEEE1394_SPEED_MAX; |
99 | module_param(max_speed, int, 0644); | 99 | module_param(max_speed, int, 0644); |
100 | MODULE_PARM_DESC(max_speed, "Force max speed (3 = 800mb, 2 = 400mb default, 1 = 200mb, 0 = 100mb)"); | 100 | MODULE_PARM_DESC(max_speed, "Force max speed (3 = 800mb, 2 = 400mb, 1 = 200mb, 0 = 100mb)"); |
101 | 101 | ||
102 | /* | 102 | /* |
103 | * Set serialize_io to 1 if you'd like only one scsi command sent | 103 | * Set serialize_io to 1 if you'd like only one scsi command sent |
104 | * down to us at a time (debugging). This might be necessary for very | 104 | * down to us at a time (debugging). This might be necessary for very |
105 | * badly behaved sbp2 devices. | 105 | * badly behaved sbp2 devices. |
106 | * | ||
107 | * TODO: Make this configurable per device. | ||
106 | */ | 108 | */ |
107 | static int serialize_io; | 109 | static int serialize_io = 1; |
108 | module_param(serialize_io, int, 0444); | 110 | module_param(serialize_io, int, 0444); |
109 | MODULE_PARM_DESC(serialize_io, "Serialize all I/O coming down from the scsi drivers (default = 0)"); | 111 | MODULE_PARM_DESC(serialize_io, "Serialize I/O coming from scsi drivers (default = 1, faster = 0)"); |
110 | 112 | ||
111 | /* | 113 | /* |
112 | * Bump up max_sectors if you'd like to support very large sized | 114 | * Bump up max_sectors if you'd like to support very large sized |
@@ -596,6 +598,14 @@ static void sbp2util_mark_command_completed(struct scsi_id_instance_data *scsi_i | |||
596 | spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags); | 598 | spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags); |
597 | } | 599 | } |
598 | 600 | ||
601 | /* | ||
602 | * Is scsi_id valid? Is the 1394 node still present? | ||
603 | */ | ||
604 | static inline int sbp2util_node_is_available(struct scsi_id_instance_data *scsi_id) | ||
605 | { | ||
606 | return scsi_id && scsi_id->ne && !scsi_id->ne->in_limbo; | ||
607 | } | ||
608 | |||
599 | 609 | ||
600 | 610 | ||
601 | /********************************************* | 611 | /********************************************* |
@@ -631,11 +641,23 @@ static int sbp2_remove(struct device *dev) | |||
631 | { | 641 | { |
632 | struct unit_directory *ud; | 642 | struct unit_directory *ud; |
633 | struct scsi_id_instance_data *scsi_id; | 643 | struct scsi_id_instance_data *scsi_id; |
644 | struct scsi_device *sdev; | ||
634 | 645 | ||
635 | SBP2_DEBUG("sbp2_remove"); | 646 | SBP2_DEBUG("sbp2_remove"); |
636 | 647 | ||
637 | ud = container_of(dev, struct unit_directory, device); | 648 | ud = container_of(dev, struct unit_directory, device); |
638 | scsi_id = ud->device.driver_data; | 649 | scsi_id = ud->device.driver_data; |
650 | if (!scsi_id) | ||
651 | return 0; | ||
652 | |||
653 | /* Trigger shutdown functions in scsi's highlevel. */ | ||
654 | if (scsi_id->scsi_host) | ||
655 | scsi_unblock_requests(scsi_id->scsi_host); | ||
656 | sdev = scsi_id->sdev; | ||
657 | if (sdev) { | ||
658 | scsi_id->sdev = NULL; | ||
659 | scsi_remove_device(sdev); | ||
660 | } | ||
639 | 661 | ||
640 | sbp2_logout_device(scsi_id); | 662 | sbp2_logout_device(scsi_id); |
641 | sbp2_remove_device(scsi_id); | 663 | sbp2_remove_device(scsi_id); |
@@ -2473,37 +2495,26 @@ static int sbp2scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
2473 | struct scsi_id_instance_data *scsi_id = | 2495 | struct scsi_id_instance_data *scsi_id = |
2474 | (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0]; | 2496 | (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0]; |
2475 | struct sbp2scsi_host_info *hi; | 2497 | struct sbp2scsi_host_info *hi; |
2498 | int result = DID_NO_CONNECT << 16; | ||
2476 | 2499 | ||
2477 | SBP2_DEBUG("sbp2scsi_queuecommand"); | 2500 | SBP2_DEBUG("sbp2scsi_queuecommand"); |
2478 | 2501 | ||
2479 | /* | 2502 | if (!sbp2util_node_is_available(scsi_id)) |
2480 | * If scsi_id is null, it means there is no device in this slot, | 2503 | goto done; |
2481 | * so we should return selection timeout. | ||
2482 | */ | ||
2483 | if (!scsi_id) { | ||
2484 | SCpnt->result = DID_NO_CONNECT << 16; | ||
2485 | done (SCpnt); | ||
2486 | return 0; | ||
2487 | } | ||
2488 | 2504 | ||
2489 | hi = scsi_id->hi; | 2505 | hi = scsi_id->hi; |
2490 | 2506 | ||
2491 | if (!hi) { | 2507 | if (!hi) { |
2492 | SBP2_ERR("sbp2scsi_host_info is NULL - this is bad!"); | 2508 | SBP2_ERR("sbp2scsi_host_info is NULL - this is bad!"); |
2493 | SCpnt->result = DID_NO_CONNECT << 16; | 2509 | goto done; |
2494 | done (SCpnt); | ||
2495 | return(0); | ||
2496 | } | 2510 | } |
2497 | 2511 | ||
2498 | /* | 2512 | /* |
2499 | * Until we handle multiple luns, just return selection time-out | 2513 | * Until we handle multiple luns, just return selection time-out |
2500 | * to any IO directed at non-zero LUNs | 2514 | * to any IO directed at non-zero LUNs |
2501 | */ | 2515 | */ |
2502 | if (SCpnt->device->lun) { | 2516 | if (SCpnt->device->lun) |
2503 | SCpnt->result = DID_NO_CONNECT << 16; | 2517 | goto done; |
2504 | done (SCpnt); | ||
2505 | return(0); | ||
2506 | } | ||
2507 | 2518 | ||
2508 | /* | 2519 | /* |
2509 | * Check for request sense command, and handle it here | 2520 | * Check for request sense command, and handle it here |
@@ -2514,7 +2525,7 @@ static int sbp2scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
2514 | memcpy(SCpnt->request_buffer, SCpnt->sense_buffer, SCpnt->request_bufflen); | 2525 | memcpy(SCpnt->request_buffer, SCpnt->sense_buffer, SCpnt->request_bufflen); |
2515 | memset(SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer)); | 2526 | memset(SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer)); |
2516 | sbp2scsi_complete_command(scsi_id, SBP2_SCSI_STATUS_GOOD, SCpnt, done); | 2527 | sbp2scsi_complete_command(scsi_id, SBP2_SCSI_STATUS_GOOD, SCpnt, done); |
2517 | return(0); | 2528 | return 0; |
2518 | } | 2529 | } |
2519 | 2530 | ||
2520 | /* | 2531 | /* |
@@ -2522,9 +2533,8 @@ static int sbp2scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
2522 | */ | 2533 | */ |
2523 | if (!hpsb_node_entry_valid(scsi_id->ne)) { | 2534 | if (!hpsb_node_entry_valid(scsi_id->ne)) { |
2524 | SBP2_ERR("Bus reset in progress - rejecting command"); | 2535 | SBP2_ERR("Bus reset in progress - rejecting command"); |
2525 | SCpnt->result = DID_BUS_BUSY << 16; | 2536 | result = DID_BUS_BUSY << 16; |
2526 | done (SCpnt); | 2537 | goto done; |
2527 | return(0); | ||
2528 | } | 2538 | } |
2529 | 2539 | ||
2530 | /* | 2540 | /* |
@@ -2535,8 +2545,12 @@ static int sbp2scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
2535 | sbp2scsi_complete_command(scsi_id, SBP2_SCSI_STATUS_SELECTION_TIMEOUT, | 2545 | sbp2scsi_complete_command(scsi_id, SBP2_SCSI_STATUS_SELECTION_TIMEOUT, |
2536 | SCpnt, done); | 2546 | SCpnt, done); |
2537 | } | 2547 | } |
2548 | return 0; | ||
2538 | 2549 | ||
2539 | return(0); | 2550 | done: |
2551 | SCpnt->result = result; | ||
2552 | done(SCpnt); | ||
2553 | return 0; | ||
2540 | } | 2554 | } |
2541 | 2555 | ||
2542 | /* | 2556 | /* |
@@ -2683,14 +2697,27 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id, | |||
2683 | } | 2697 | } |
2684 | 2698 | ||
2685 | 2699 | ||
2686 | static int sbp2scsi_slave_configure (struct scsi_device *sdev) | 2700 | static int sbp2scsi_slave_alloc(struct scsi_device *sdev) |
2687 | { | 2701 | { |
2688 | blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); | 2702 | ((struct scsi_id_instance_data *)sdev->host->hostdata[0])->sdev = sdev; |
2703 | return 0; | ||
2704 | } | ||
2705 | |||
2689 | 2706 | ||
2707 | static int sbp2scsi_slave_configure(struct scsi_device *sdev) | ||
2708 | { | ||
2709 | blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); | ||
2690 | return 0; | 2710 | return 0; |
2691 | } | 2711 | } |
2692 | 2712 | ||
2693 | 2713 | ||
2714 | static void sbp2scsi_slave_destroy(struct scsi_device *sdev) | ||
2715 | { | ||
2716 | ((struct scsi_id_instance_data *)sdev->host->hostdata[0])->sdev = NULL; | ||
2717 | return; | ||
2718 | } | ||
2719 | |||
2720 | |||
2694 | /* | 2721 | /* |
2695 | * Called by scsi stack when something has really gone wrong. Usually | 2722 | * Called by scsi stack when something has really gone wrong. Usually |
2696 | * called when a command has timed-out for some reason. | 2723 | * called when a command has timed-out for some reason. |
@@ -2705,7 +2732,7 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt) | |||
2705 | SBP2_ERR("aborting sbp2 command"); | 2732 | SBP2_ERR("aborting sbp2 command"); |
2706 | scsi_print_command(SCpnt); | 2733 | scsi_print_command(SCpnt); |
2707 | 2734 | ||
2708 | if (scsi_id) { | 2735 | if (sbp2util_node_is_available(scsi_id)) { |
2709 | 2736 | ||
2710 | /* | 2737 | /* |
2711 | * Right now, just return any matching command structures | 2738 | * Right now, just return any matching command structures |
@@ -2742,31 +2769,24 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt) | |||
2742 | /* | 2769 | /* |
2743 | * Called by scsi stack when something has really gone wrong. | 2770 | * Called by scsi stack when something has really gone wrong. |
2744 | */ | 2771 | */ |
2745 | static int __sbp2scsi_reset(struct scsi_cmnd *SCpnt) | 2772 | static int sbp2scsi_reset(struct scsi_cmnd *SCpnt) |
2746 | { | 2773 | { |
2747 | struct scsi_id_instance_data *scsi_id = | 2774 | struct scsi_id_instance_data *scsi_id = |
2748 | (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0]; | 2775 | (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0]; |
2776 | unsigned long flags; | ||
2749 | 2777 | ||
2750 | SBP2_ERR("reset requested"); | 2778 | SBP2_ERR("reset requested"); |
2751 | 2779 | ||
2752 | if (scsi_id) { | 2780 | spin_lock_irqsave(SCpnt->device->host->host_lock, flags); |
2781 | |||
2782 | if (sbp2util_node_is_available(scsi_id)) { | ||
2753 | SBP2_ERR("Generating sbp2 fetch agent reset"); | 2783 | SBP2_ERR("Generating sbp2 fetch agent reset"); |
2754 | sbp2_agent_reset(scsi_id, 0); | 2784 | sbp2_agent_reset(scsi_id, 0); |
2755 | } | 2785 | } |
2756 | 2786 | ||
2757 | return(SUCCESS); | ||
2758 | } | ||
2759 | |||
2760 | static int sbp2scsi_reset(struct scsi_cmnd *SCpnt) | ||
2761 | { | ||
2762 | unsigned long flags; | ||
2763 | int rc; | ||
2764 | |||
2765 | spin_lock_irqsave(SCpnt->device->host->host_lock, flags); | ||
2766 | rc = __sbp2scsi_reset(SCpnt); | ||
2767 | spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); | 2787 | spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags); |
2768 | 2788 | ||
2769 | return rc; | 2789 | return SUCCESS; |
2770 | } | 2790 | } |
2771 | 2791 | ||
2772 | static const char *sbp2scsi_info (struct Scsi_Host *host) | 2792 | static const char *sbp2scsi_info (struct Scsi_Host *host) |
@@ -2817,7 +2837,9 @@ static struct scsi_host_template scsi_driver_template = { | |||
2817 | .eh_device_reset_handler = sbp2scsi_reset, | 2837 | .eh_device_reset_handler = sbp2scsi_reset, |
2818 | .eh_bus_reset_handler = sbp2scsi_reset, | 2838 | .eh_bus_reset_handler = sbp2scsi_reset, |
2819 | .eh_host_reset_handler = sbp2scsi_reset, | 2839 | .eh_host_reset_handler = sbp2scsi_reset, |
2840 | .slave_alloc = sbp2scsi_slave_alloc, | ||
2820 | .slave_configure = sbp2scsi_slave_configure, | 2841 | .slave_configure = sbp2scsi_slave_configure, |
2842 | .slave_destroy = sbp2scsi_slave_destroy, | ||
2821 | .this_id = -1, | 2843 | .this_id = -1, |
2822 | .sg_tablesize = SG_ALL, | 2844 | .sg_tablesize = SG_ALL, |
2823 | .use_clustering = ENABLE_CLUSTERING, | 2845 | .use_clustering = ENABLE_CLUSTERING, |
@@ -2837,7 +2859,8 @@ static int sbp2_module_init(void) | |||
2837 | 2859 | ||
2838 | /* Module load debug option to force one command at a time (serializing I/O) */ | 2860 | /* Module load debug option to force one command at a time (serializing I/O) */ |
2839 | if (serialize_io) { | 2861 | if (serialize_io) { |
2840 | SBP2_ERR("Driver forced to serialize I/O (serialize_io = 1)"); | 2862 | SBP2_INFO("Driver forced to serialize I/O (serialize_io=1)"); |
2863 | SBP2_INFO("Try serialize_io=0 for better performance"); | ||
2841 | scsi_driver_template.can_queue = 1; | 2864 | scsi_driver_template.can_queue = 1; |
2842 | scsi_driver_template.cmd_per_lun = 1; | 2865 | scsi_driver_template.cmd_per_lun = 1; |
2843 | } | 2866 | } |
diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c index 9d6facf2f78f..11be9c9c82a8 100644 --- a/drivers/ieee1394/video1394.c +++ b/drivers/ieee1394/video1394.c | |||
@@ -1571,4 +1571,3 @@ static int __init video1394_init_module (void) | |||
1571 | 1571 | ||
1572 | module_init(video1394_init_module); | 1572 | module_init(video1394_init_module); |
1573 | module_exit(video1394_exit_module); | 1573 | module_exit(video1394_exit_module); |
1574 | MODULE_ALIAS_CHARDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_VIDEO1394 * 16); | ||