blob: b248d89de8b4e26c543d5b30c2bd7a187d657059 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * IEEE 1394 for Linux
3 *
4 * Core support: hpsb_packet management, packet handling and forwarding to
5 * highlevel or lowlevel code
6 *
7 * Copyright (C) 1999, 2000 Andreas E. Bombe
8 * 2002 Manfred Weihs <weihs@ict.tuwien.ac.at>
9 *
10 * This code is licensed under the GPL. See the file COPYING in the root
11 * directory of the kernel sources for details.
12 *
13 *
14 * Contributions:
15 *
16 * Manfred Weihs <weihs@ict.tuwien.ac.at>
17 * loopback functionality in hpsb_send_packet
18 * allow highlevel drivers to disable automatic response generation
19 * and to generate responses themselves (deferred)
20 *
21 */
22
23#include <linux/config.h>
24#include <linux/kernel.h>
25#include <linux/list.h>
26#include <linux/string.h>
27#include <linux/init.h>
28#include <linux/slab.h>
29#include <linux/interrupt.h>
30#include <linux/module.h>
31#include <linux/moduleparam.h>
32#include <linux/bitops.h>
33#include <linux/kdev_t.h>
34#include <linux/skbuff.h>
35#include <linux/suspend.h>
36
37#include <asm/byteorder.h>
38#include <asm/semaphore.h>
39
40#include "ieee1394_types.h"
41#include "ieee1394.h"
42#include "hosts.h"
43#include "ieee1394_core.h"
44#include "highlevel.h"
45#include "ieee1394_transactions.h"
46#include "csr.h"
47#include "nodemgr.h"
48#include "dma.h"
49#include "iso.h"
50#include "config_roms.h"
51
52/*
53 * Disable the nodemgr detection and config rom reading functionality.
54 */
Ben Collins1934b8b2005-07-09 20:01:23 -040055static int disable_nodemgr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070056module_param(disable_nodemgr, int, 0444);
57MODULE_PARM_DESC(disable_nodemgr, "Disable nodemgr functionality.");
58
59/* Disable Isochronous Resource Manager functionality */
60int hpsb_disable_irm = 0;
61module_param_named(disable_irm, hpsb_disable_irm, bool, 0);
62MODULE_PARM_DESC(disable_irm,
63 "Disable Isochronous Resource Manager functionality.");
64
65/* We are GPL, so treat us special */
66MODULE_LICENSE("GPL");
67
68/* Some globals used */
69const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S3200" };
gregkh@suse.de7e25ab92005-03-23 09:53:36 -080070struct class *hpsb_protocol_class;
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
72#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
73static void dump_packet(const char *text, quadlet_t *data, int size)
74{
75 int i;
76
77 size /= 4;
78 size = (size > 4 ? 4 : size);
79
80 printk(KERN_DEBUG "ieee1394: %s", text);
81 for (i = 0; i < size; i++)
82 printk(" %08x", data[i]);
83 printk("\n");
84}
85#else
86#define dump_packet(x,y,z)
87#endif
88
89static void abort_requests(struct hpsb_host *host);
90static void queue_packet_complete(struct hpsb_packet *packet);
91
92
93/**
94 * hpsb_set_packet_complete_task - set the task that runs when a packet
95 * completes. You cannot call this more than once on a single packet
96 * before it is sent.
97 *
98 * @packet: the packet whose completion we want the task added to
99 * @routine: function to call
100 * @data: data (if any) to pass to the above function
101 */
102void hpsb_set_packet_complete_task(struct hpsb_packet *packet,
103 void (*routine)(void *), void *data)
104{
105 WARN_ON(packet->complete_routine != NULL);
106 packet->complete_routine = routine;
107 packet->complete_data = data;
108 return;
109}
110
111/**
112 * hpsb_alloc_packet - allocate new packet structure
113 * @data_size: size of the data block to be allocated
114 *
115 * This function allocates, initializes and returns a new &struct hpsb_packet.
116 * It can be used in interrupt context. A header block is always included, its
117 * size is big enough to contain all possible 1394 headers. The data block is
118 * only allocated when @data_size is not zero.
119 *
120 * For packets for which responses will be received the @data_size has to be big
121 * enough to contain the response's data block since no further allocation
122 * occurs at response matching time.
123 *
124 * The packet's generation value will be set to the current generation number
125 * for ease of use. Remember to overwrite it with your own recorded generation
126 * number if you can not be sure that your code will not race with a bus reset.
127 *
128 * Return value: A pointer to a &struct hpsb_packet or NULL on allocation
129 * failure.
130 */
131struct hpsb_packet *hpsb_alloc_packet(size_t data_size)
132{
133 struct hpsb_packet *packet = NULL;
134 struct sk_buff *skb;
135
136 data_size = ((data_size + 3) & ~3);
137
138 skb = alloc_skb(data_size + sizeof(*packet), GFP_ATOMIC);
139 if (skb == NULL)
140 return NULL;
141
142 memset(skb->data, 0, data_size + sizeof(*packet));
143
144 packet = (struct hpsb_packet *)skb->data;
145 packet->skb = skb;
146
147 packet->header = packet->embedded_header;
148 packet->state = hpsb_unused;
149 packet->generation = -1;
150 INIT_LIST_HEAD(&packet->driver_list);
151 atomic_set(&packet->refcnt, 1);
152
153 if (data_size) {
154 packet->data = (quadlet_t *)(skb->data + sizeof(*packet));
155 packet->data_size = data_size;
156 }
157
158 return packet;
159}
160
161
162/**
163 * hpsb_free_packet - free packet and data associated with it
164 * @packet: packet to free (is NULL safe)
165 *
166 * This function will free packet->data and finally the packet itself.
167 */
168void hpsb_free_packet(struct hpsb_packet *packet)
169{
170 if (packet && atomic_dec_and_test(&packet->refcnt)) {
171 BUG_ON(!list_empty(&packet->driver_list));
172 kfree_skb(packet->skb);
173 }
174}
175
176
177int hpsb_reset_bus(struct hpsb_host *host, int type)
178{
179 if (!host->in_bus_reset) {
180 host->driver->devctl(host, RESET_BUS, type);
181 return 0;
182 } else {
183 return 1;
184 }
185}
186
187
188int hpsb_bus_reset(struct hpsb_host *host)
189{
190 if (host->in_bus_reset) {
191 HPSB_NOTICE("%s called while bus reset already in progress",
192 __FUNCTION__);
193 return 1;
194 }
195
196 abort_requests(host);
197 host->in_bus_reset = 1;
198 host->irm_id = -1;
199 host->is_irm = 0;
200 host->busmgr_id = -1;
201 host->is_busmgr = 0;
202 host->is_cycmst = 0;
203 host->node_count = 0;
204 host->selfid_count = 0;
205
206 return 0;
207}
208
209
210/*
211 * Verify num_of_selfids SelfIDs and return number of nodes. Return zero in
212 * case verification failed.
213 */
214static int check_selfids(struct hpsb_host *host)
215{
216 int nodeid = -1;
217 int rest_of_selfids = host->selfid_count;
218 struct selfid *sid = (struct selfid *)host->topology_map;
219 struct ext_selfid *esid;
220 int esid_seq = 23;
221
222 host->nodes_active = 0;
223
224 while (rest_of_selfids--) {
225 if (!sid->extended) {
226 nodeid++;
227 esid_seq = 0;
228
229 if (sid->phy_id != nodeid) {
230 HPSB_INFO("SelfIDs failed monotony check with "
231 "%d", sid->phy_id);
232 return 0;
233 }
234
235 if (sid->link_active) {
236 host->nodes_active++;
237 if (sid->contender)
238 host->irm_id = LOCAL_BUS | sid->phy_id;
239 }
240 } else {
241 esid = (struct ext_selfid *)sid;
242
243 if ((esid->phy_id != nodeid)
244 || (esid->seq_nr != esid_seq)) {
245 HPSB_INFO("SelfIDs failed monotony check with "
246 "%d/%d", esid->phy_id, esid->seq_nr);
247 return 0;
248 }
249 esid_seq++;
250 }
251 sid++;
252 }
253
254 esid = (struct ext_selfid *)(sid - 1);
255 while (esid->extended) {
256 if ((esid->porta == 0x2) || (esid->portb == 0x2)
257 || (esid->portc == 0x2) || (esid->portd == 0x2)
258 || (esid->porte == 0x2) || (esid->portf == 0x2)
259 || (esid->portg == 0x2) || (esid->porth == 0x2)) {
260 HPSB_INFO("SelfIDs failed root check on "
261 "extended SelfID");
262 return 0;
263 }
264 esid--;
265 }
266
267 sid = (struct selfid *)esid;
268 if ((sid->port0 == 0x2) || (sid->port1 == 0x2) || (sid->port2 == 0x2)) {
269 HPSB_INFO("SelfIDs failed root check");
270 return 0;
271 }
272
273 host->node_count = nodeid + 1;
274 return 1;
275}
276
277static void build_speed_map(struct hpsb_host *host, int nodecount)
278{
279 u8 speedcap[nodecount];
280 u8 cldcnt[nodecount];
281 u8 *map = host->speed_map;
282 struct selfid *sid;
283 struct ext_selfid *esid;
284 int i, j, n;
285
286 for (i = 0; i < (nodecount * 64); i += 64) {
287 for (j = 0; j < nodecount; j++) {
288 map[i+j] = IEEE1394_SPEED_MAX;
289 }
290 }
291
292 for (i = 0; i < nodecount; i++) {
293 cldcnt[i] = 0;
294 }
295
296 /* find direct children count and speed */
297 for (sid = (struct selfid *)&host->topology_map[host->selfid_count-1],
298 n = nodecount - 1;
299 (void *)sid >= (void *)host->topology_map; sid--) {
300 if (sid->extended) {
301 esid = (struct ext_selfid *)sid;
302
303 if (esid->porta == 0x3) cldcnt[n]++;
304 if (esid->portb == 0x3) cldcnt[n]++;
305 if (esid->portc == 0x3) cldcnt[n]++;
306 if (esid->portd == 0x3) cldcnt[n]++;
307 if (esid->porte == 0x3) cldcnt[n]++;
308 if (esid->portf == 0x3) cldcnt[n]++;
309 if (esid->portg == 0x3) cldcnt[n]++;
310 if (esid->porth == 0x3) cldcnt[n]++;
311 } else {
312 if (sid->port0 == 0x3) cldcnt[n]++;
313 if (sid->port1 == 0x3) cldcnt[n]++;
314 if (sid->port2 == 0x3) cldcnt[n]++;
315
316 speedcap[n] = sid->speed;
317 n--;
318 }
319 }
320
321 /* set self mapping */
322 for (i = 0; i < nodecount; i++) {
323 map[64*i + i] = speedcap[i];
324 }
325
326 /* fix up direct children count to total children count;
327 * also fix up speedcaps for sibling and parent communication */
328 for (i = 1; i < nodecount; i++) {
329 for (j = cldcnt[i], n = i - 1; j > 0; j--) {
330 cldcnt[i] += cldcnt[n];
331 speedcap[n] = min(speedcap[n], speedcap[i]);
332 n -= cldcnt[n] + 1;
333 }
334 }
335
336 for (n = 0; n < nodecount; n++) {
337 for (i = n - cldcnt[n]; i <= n; i++) {
338 for (j = 0; j < (n - cldcnt[n]); j++) {
339 map[j*64 + i] = map[i*64 + j] =
340 min(map[i*64 + j], speedcap[n]);
341 }
342 for (j = n + 1; j < nodecount; j++) {
343 map[j*64 + i] = map[i*64 + j] =
344 min(map[i*64 + j], speedcap[n]);
345 }
346 }
347 }
348}
349
350
351void hpsb_selfid_received(struct hpsb_host *host, quadlet_t sid)
352{
353 if (host->in_bus_reset) {
354 HPSB_VERBOSE("Including SelfID 0x%x", sid);
355 host->topology_map[host->selfid_count++] = sid;
356 } else {
357 HPSB_NOTICE("Spurious SelfID packet (0x%08x) received from bus %d",
358 sid, NODEID_TO_BUS(host->node_id));
359 }
360}
361
362void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot)
363{
364 if (!host->in_bus_reset)
365 HPSB_NOTICE("SelfID completion called outside of bus reset!");
366
367 host->node_id = LOCAL_BUS | phyid;
368 host->is_root = isroot;
369
370 if (!check_selfids(host)) {
371 if (host->reset_retries++ < 20) {
372 /* selfid stage did not complete without error */
373 HPSB_NOTICE("Error in SelfID stage, resetting");
374 host->in_bus_reset = 0;
375 /* this should work from ohci1394 now... */
376 hpsb_reset_bus(host, LONG_RESET);
377 return;
378 } else {
379 HPSB_NOTICE("Stopping out-of-control reset loop");
380 HPSB_NOTICE("Warning - topology map and speed map will not be valid");
381 host->reset_retries = 0;
382 }
383 } else {
384 host->reset_retries = 0;
385 build_speed_map(host, host->node_count);
386 }
387
388 HPSB_VERBOSE("selfid_complete called with successful SelfID stage "
389 "... irm_id: 0x%X node_id: 0x%X",host->irm_id,host->node_id);
390
391 /* irm_id is kept up to date by check_selfids() */
392 if (host->irm_id == host->node_id) {
393 host->is_irm = 1;
394 } else {
395 host->is_busmgr = 0;
396 host->is_irm = 0;
397 }
398
399 if (isroot) {
400 host->driver->devctl(host, ACT_CYCLE_MASTER, 1);
401 host->is_cycmst = 1;
402 }
403 atomic_inc(&host->generation);
404 host->in_bus_reset = 0;
405 highlevel_host_reset(host);
406}
407
408
409void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet,
410 int ackcode)
411{
412 unsigned long flags;
413
414 spin_lock_irqsave(&host->pending_packet_queue.lock, flags);
415
416 packet->ack_code = ackcode;
417
418 if (packet->no_waiter || packet->state == hpsb_complete) {
419 /* if packet->no_waiter, must not have a tlabel allocated */
420 spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
421 hpsb_free_packet(packet);
422 return;
423 }
424
425 atomic_dec(&packet->refcnt); /* drop HC's reference */
426 /* here the packet must be on the host->pending_packet_queue */
427
428 if (ackcode != ACK_PENDING || !packet->expect_response) {
429 packet->state = hpsb_complete;
430 __skb_unlink(packet->skb, &host->pending_packet_queue);
431 spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
432 queue_packet_complete(packet);
433 return;
434 }
435
436 packet->state = hpsb_pending;
437 packet->sendtime = jiffies;
438
439 spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
440
441 mod_timer(&host->timeout, jiffies + host->timeout_interval);
442}
443
444/**
445 * hpsb_send_phy_config - transmit a PHY configuration packet on the bus
446 * @host: host that PHY config packet gets sent through
447 * @rootid: root whose force_root bit should get set (-1 = don't set force_root)
448 * @gapcnt: gap count value to set (-1 = don't set gap count)
449 *
450 * This function sends a PHY config packet on the bus through the specified host.
451 *
452 * Return value: 0 for success or error number otherwise.
453 */
454int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt)
455{
456 struct hpsb_packet *packet;
457 int retval = 0;
458
459 if (rootid >= ALL_NODES || rootid < -1 || gapcnt > 0x3f || gapcnt < -1 ||
460 (rootid == -1 && gapcnt == -1)) {
461 HPSB_DEBUG("Invalid Parameter: rootid = %d gapcnt = %d",
462 rootid, gapcnt);
463 return -EINVAL;
464 }
465
466 packet = hpsb_alloc_packet(0);
467 if (!packet)
468 return -ENOMEM;
469
470 packet->host = host;
471 packet->header_size = 8;
472 packet->data_size = 0;
473 packet->expect_response = 0;
474 packet->no_waiter = 0;
475 packet->type = hpsb_raw;
476 packet->header[0] = 0;
477 if (rootid != -1)
478 packet->header[0] |= rootid << 24 | 1 << 23;
479 if (gapcnt != -1)
480 packet->header[0] |= gapcnt << 16 | 1 << 22;
481
482 packet->header[1] = ~packet->header[0];
483
484 packet->generation = get_hpsb_generation(host);
485
486 retval = hpsb_send_packet_and_wait(packet);
487 hpsb_free_packet(packet);
488
489 return retval;
490}
491
492/**
493 * hpsb_send_packet - transmit a packet on the bus
494 * @packet: packet to send
495 *
496 * The packet is sent through the host specified in the packet->host field.
497 * Before sending, the packet's transmit speed is automatically determined
498 * using the local speed map when it is an async, non-broadcast packet.
499 *
500 * Possibilities for failure are that host is either not initialized, in bus
501 * reset, the packet's generation number doesn't match the current generation
502 * number or the host reports a transmit error.
503 *
504 * Return value: 0 on success, negative errno on failure.
505 */
506int hpsb_send_packet(struct hpsb_packet *packet)
507{
508 struct hpsb_host *host = packet->host;
509
510 if (host->is_shutdown)
511 return -EINVAL;
512 if (host->in_bus_reset ||
513 (packet->generation != get_hpsb_generation(host)))
514 return -EAGAIN;
515
516 packet->state = hpsb_queued;
517
518 /* This just seems silly to me */
519 WARN_ON(packet->no_waiter && packet->expect_response);
520
521 if (!packet->no_waiter || packet->expect_response) {
522 atomic_inc(&packet->refcnt);
Ben Collins1934b8b2005-07-09 20:01:23 -0400523 /* Set the initial "sendtime" to 10 seconds from now, to
524 prevent premature expiry. If a packet takes more than
525 10 seconds to hit the wire, we have bigger problems :) */
Jody McIntyre6262d062005-05-16 21:54:05 -0700526 packet->sendtime = jiffies + 10 * HZ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527 skb_queue_tail(&host->pending_packet_queue, packet->skb);
528 }
529
530 if (packet->node_id == host->node_id) {
531 /* it is a local request, so handle it locally */
532
533 quadlet_t *data;
534 size_t size = packet->data_size + packet->header_size;
535
536 data = kmalloc(size, GFP_ATOMIC);
537 if (!data) {
538 HPSB_ERR("unable to allocate memory for concatenating header and data");
539 return -ENOMEM;
540 }
541
542 memcpy(data, packet->header, packet->header_size);
543
544 if (packet->data_size)
545 memcpy(((u8*)data) + packet->header_size, packet->data, packet->data_size);
546
547 dump_packet("send packet local:", packet->header,
548 packet->header_size);
549
550 hpsb_packet_sent(host, packet, packet->expect_response ? ACK_PENDING : ACK_COMPLETE);
551 hpsb_packet_received(host, data, size, 0);
552
553 kfree(data);
554
555 return 0;
556 }
557
558 if (packet->type == hpsb_async && packet->node_id != ALL_NODES) {
559 packet->speed_code =
560 host->speed_map[NODEID_TO_NODE(host->node_id) * 64
561 + NODEID_TO_NODE(packet->node_id)];
562 }
563
564#ifdef CONFIG_IEEE1394_VERBOSEDEBUG
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
580 return host->driver->transmit_packet(host, packet);
581}
582
583/* We could just use complete() directly as the packet complete
584 * callback, but this is more typesafe, in the sense that we get a
585 * compiler error if the prototype for complete() changes. */
586
587static void complete_packet(void *data)
588{
589 complete((struct completion *) data);
590}
591
592int hpsb_send_packet_and_wait(struct hpsb_packet *packet)
593{
594 struct completion done;
595 int retval;
596
597 init_completion(&done);
598 hpsb_set_packet_complete_task(packet, complete_packet, &done);
599 retval = hpsb_send_packet(packet);
600 if (retval == 0)
601 wait_for_completion(&done);
602
603 return retval;
604}
605
606static void send_packet_nocare(struct hpsb_packet *packet)
607{
608 if (hpsb_send_packet(packet) < 0) {
609 hpsb_free_packet(packet);
610 }
611}
612
613
614static void handle_packet_response(struct hpsb_host *host, int tcode,
615 quadlet_t *data, size_t size)
616{
617 struct hpsb_packet *packet = NULL;
618 struct sk_buff *skb;
619 int tcode_match = 0;
620 int tlabel;
621 unsigned long flags;
622
623 tlabel = (data[0] >> 10) & 0x3f;
624
625 spin_lock_irqsave(&host->pending_packet_queue.lock, flags);
626
627 skb_queue_walk(&host->pending_packet_queue, skb) {
628 packet = (struct hpsb_packet *)skb->data;
629 if ((packet->tlabel == tlabel)
630 && (packet->node_id == (data[1] >> 16))){
631 break;
632 }
633
634 packet = NULL;
635 }
636
637 if (packet == NULL) {
638 HPSB_DEBUG("unsolicited response packet received - no tlabel match");
639 dump_packet("contents:", data, 16);
640 spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
641 return;
642 }
643
644 switch (packet->tcode) {
645 case TCODE_WRITEQ:
646 case TCODE_WRITEB:
647 if (tcode != TCODE_WRITE_RESPONSE)
648 break;
649 tcode_match = 1;
650 memcpy(packet->header, data, 12);
651 break;
652 case TCODE_READQ:
653 if (tcode != TCODE_READQ_RESPONSE)
654 break;
655 tcode_match = 1;
656 memcpy(packet->header, data, 16);
657 break;
658 case TCODE_READB:
659 if (tcode != TCODE_READB_RESPONSE)
660 break;
661 tcode_match = 1;
662 BUG_ON(packet->skb->len - sizeof(*packet) < size - 16);
663 memcpy(packet->header, data, 16);
664 memcpy(packet->data, data + 4, size - 16);
665 break;
666 case TCODE_LOCK_REQUEST:
667 if (tcode != TCODE_LOCK_RESPONSE)
668 break;
669 tcode_match = 1;
670 size = min((size - 16), (size_t)8);
671 BUG_ON(packet->skb->len - sizeof(*packet) < size);
672 memcpy(packet->header, data, 16);
673 memcpy(packet->data, data + 4, size);
674 break;
675 }
676
677 if (!tcode_match) {
678 spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
679 HPSB_INFO("unsolicited response packet received - tcode mismatch");
680 dump_packet("contents:", data, 16);
681 return;
682 }
683
684 __skb_unlink(skb, skb->list);
685
686 if (packet->state == hpsb_queued) {
687 packet->sendtime = jiffies;
688 packet->ack_code = ACK_PENDING;
689 }
690
691 packet->state = hpsb_complete;
692 spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
693
694 queue_packet_complete(packet);
695}
696
697
698static struct hpsb_packet *create_reply_packet(struct hpsb_host *host,
699 quadlet_t *data, size_t dsize)
700{
701 struct hpsb_packet *p;
702
703 p = hpsb_alloc_packet(dsize);
704 if (unlikely(p == NULL)) {
705 /* FIXME - send data_error response */
706 return NULL;
707 }
708
709 p->type = hpsb_async;
710 p->state = hpsb_unused;
711 p->host = host;
712 p->node_id = data[1] >> 16;
713 p->tlabel = (data[0] >> 10) & 0x3f;
714 p->no_waiter = 1;
715
716 p->generation = get_hpsb_generation(host);
717
718 if (dsize % 4)
719 p->data[dsize / 4] = 0;
720
721 return p;
722}
723
724#define PREP_ASYNC_HEAD_RCODE(tc) \
725 packet->tcode = tc; \
726 packet->header[0] = (packet->node_id << 16) | (packet->tlabel << 10) \
727 | (1 << 8) | (tc << 4); \
728 packet->header[1] = (packet->host->node_id << 16) | (rcode << 12); \
729 packet->header[2] = 0
730
731static void fill_async_readquad_resp(struct hpsb_packet *packet, int rcode,
732 quadlet_t data)
733{
734 PREP_ASYNC_HEAD_RCODE(TCODE_READQ_RESPONSE);
735 packet->header[3] = data;
736 packet->header_size = 16;
737 packet->data_size = 0;
738}
739
740static void fill_async_readblock_resp(struct hpsb_packet *packet, int rcode,
741 int length)
742{
743 if (rcode != RCODE_COMPLETE)
744 length = 0;
745
746 PREP_ASYNC_HEAD_RCODE(TCODE_READB_RESPONSE);
747 packet->header[3] = length << 16;
748 packet->header_size = 16;
749 packet->data_size = length + (length % 4 ? 4 - (length % 4) : 0);
750}
751
752static void fill_async_write_resp(struct hpsb_packet *packet, int rcode)
753{
754 PREP_ASYNC_HEAD_RCODE(TCODE_WRITE_RESPONSE);
755 packet->header[2] = 0;
756 packet->header_size = 12;
757 packet->data_size = 0;
758}
759
760static void fill_async_lock_resp(struct hpsb_packet *packet, int rcode, int extcode,
761 int length)
762{
763 if (rcode != RCODE_COMPLETE)
764 length = 0;
765
766 PREP_ASYNC_HEAD_RCODE(TCODE_LOCK_RESPONSE);
767 packet->header[3] = (length << 16) | extcode;
768 packet->header_size = 16;
769 packet->data_size = length;
770}
771
772#define PREP_REPLY_PACKET(length) \
773 packet = create_reply_packet(host, data, length); \
774 if (packet == NULL) break
775
776static void handle_incoming_packet(struct hpsb_host *host, int tcode,
777 quadlet_t *data, size_t size, int write_acked)
778{
779 struct hpsb_packet *packet;
780 int length, rcode, extcode;
781 quadlet_t buffer;
782 nodeid_t source = data[1] >> 16;
783 nodeid_t dest = data[0] >> 16;
784 u16 flags = (u16) data[0];
785 u64 addr;
786
787 /* big FIXME - no error checking is done for an out of bounds length */
788
789 switch (tcode) {
790 case TCODE_WRITEQ:
791 addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
792 rcode = highlevel_write(host, source, dest, data+3,
793 addr, 4, flags);
794
795 if (!write_acked
796 && (NODEID_TO_NODE(data[0] >> 16) != NODE_MASK)
797 && (rcode >= 0)) {
798 /* not a broadcast write, reply */
799 PREP_REPLY_PACKET(0);
800 fill_async_write_resp(packet, rcode);
801 send_packet_nocare(packet);
802 }
803 break;
804
805 case TCODE_WRITEB:
806 addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
807 rcode = highlevel_write(host, source, dest, data+4,
808 addr, data[3]>>16, flags);
809
810 if (!write_acked
811 && (NODEID_TO_NODE(data[0] >> 16) != NODE_MASK)
812 && (rcode >= 0)) {
813 /* not a broadcast write, reply */
814 PREP_REPLY_PACKET(0);
815 fill_async_write_resp(packet, rcode);
816 send_packet_nocare(packet);
817 }
818 break;
819
820 case TCODE_READQ:
821 addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
822 rcode = highlevel_read(host, source, &buffer, addr, 4, flags);
823
824 if (rcode >= 0) {
825 PREP_REPLY_PACKET(0);
826 fill_async_readquad_resp(packet, rcode, buffer);
827 send_packet_nocare(packet);
828 }
829 break;
830
831 case TCODE_READB:
832 length = data[3] >> 16;
833 PREP_REPLY_PACKET(length);
834
835 addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
836 rcode = highlevel_read(host, source, packet->data, addr,
837 length, flags);
838
839 if (rcode >= 0) {
840 fill_async_readblock_resp(packet, rcode, length);
841 send_packet_nocare(packet);
842 } else {
843 hpsb_free_packet(packet);
844 }
845 break;
846
847 case TCODE_LOCK_REQUEST:
848 length = data[3] >> 16;
849 extcode = data[3] & 0xffff;
850 addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
851
852 PREP_REPLY_PACKET(8);
853
854 if ((extcode == 0) || (extcode >= 7)) {
855 /* let switch default handle error */
856 length = 0;
857 }
858
859 switch (length) {
860 case 4:
861 rcode = highlevel_lock(host, source, packet->data, addr,
862 data[4], 0, extcode,flags);
863 fill_async_lock_resp(packet, rcode, extcode, 4);
864 break;
865 case 8:
866 if ((extcode != EXTCODE_FETCH_ADD)
867 && (extcode != EXTCODE_LITTLE_ADD)) {
868 rcode = highlevel_lock(host, source,
869 packet->data, addr,
870 data[5], data[4],
871 extcode, flags);
872 fill_async_lock_resp(packet, rcode, extcode, 4);
873 } else {
874 rcode = highlevel_lock64(host, source,
875 (octlet_t *)packet->data, addr,
876 *(octlet_t *)(data + 4), 0ULL,
877 extcode, flags);
878 fill_async_lock_resp(packet, rcode, extcode, 8);
879 }
880 break;
881 case 16:
882 rcode = highlevel_lock64(host, source,
883 (octlet_t *)packet->data, addr,
884 *(octlet_t *)(data + 6),
885 *(octlet_t *)(data + 4),
886 extcode, flags);
887 fill_async_lock_resp(packet, rcode, extcode, 8);
888 break;
889 default:
890 rcode = RCODE_TYPE_ERROR;
891 fill_async_lock_resp(packet, rcode,
892 extcode, 0);
893 }
894
895 if (rcode >= 0) {
896 send_packet_nocare(packet);
897 } else {
898 hpsb_free_packet(packet);
899 }
900 break;
901 }
902
903}
904#undef PREP_REPLY_PACKET
905
906
907void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
908 int write_acked)
909{
910 int tcode;
911
912 if (host->in_bus_reset) {
913 HPSB_INFO("received packet during reset; ignoring");
914 return;
915 }
916
917 dump_packet("received packet:", data, size);
918
919 tcode = (data[0] >> 4) & 0xf;
920
921 switch (tcode) {
922 case TCODE_WRITE_RESPONSE:
923 case TCODE_READQ_RESPONSE:
924 case TCODE_READB_RESPONSE:
925 case TCODE_LOCK_RESPONSE:
926 handle_packet_response(host, tcode, data, size);
927 break;
928
929 case TCODE_WRITEQ:
930 case TCODE_WRITEB:
931 case TCODE_READQ:
932 case TCODE_READB:
933 case TCODE_LOCK_REQUEST:
934 handle_incoming_packet(host, tcode, data, size, write_acked);
935 break;
936
937
938 case TCODE_ISO_DATA:
939 highlevel_iso_receive(host, data, size);
940 break;
941
942 case TCODE_CYCLE_START:
943 /* simply ignore this packet if it is passed on */
944 break;
945
946 default:
947 HPSB_NOTICE("received packet with bogus transaction code %d",
948 tcode);
949 break;
950 }
951}
952
953
954static void abort_requests(struct hpsb_host *host)
955{
956 struct hpsb_packet *packet;
957 struct sk_buff *skb;
958
959 host->driver->devctl(host, CANCEL_REQUESTS, 0);
960
961 while ((skb = skb_dequeue(&host->pending_packet_queue)) != NULL) {
962 packet = (struct hpsb_packet *)skb->data;
963
964 packet->state = hpsb_complete;
965 packet->ack_code = ACKX_ABORTED;
966 queue_packet_complete(packet);
967 }
968}
969
970void abort_timedouts(unsigned long __opaque)
971{
972 struct hpsb_host *host = (struct hpsb_host *)__opaque;
973 unsigned long flags;
974 struct hpsb_packet *packet;
975 struct sk_buff *skb;
976 unsigned long expire;
977
978 spin_lock_irqsave(&host->csr.lock, flags);
979 expire = host->csr.expire;
980 spin_unlock_irqrestore(&host->csr.lock, flags);
981
982 /* Hold the lock around this, since we aren't dequeuing all
983 * packets, just ones we need. */
984 spin_lock_irqsave(&host->pending_packet_queue.lock, flags);
985
986 while (!skb_queue_empty(&host->pending_packet_queue)) {
987 skb = skb_peek(&host->pending_packet_queue);
988
989 packet = (struct hpsb_packet *)skb->data;
990
991 if (time_before(packet->sendtime + expire, jiffies)) {
992 __skb_unlink(skb, skb->list);
993 packet->state = hpsb_complete;
994 packet->ack_code = ACKX_TIMEOUT;
995 queue_packet_complete(packet);
996 } else {
997 /* Since packets are added to the tail, the oldest
998 * ones are first, always. When we get to one that
999 * isn't timed out, the rest aren't either. */
1000 break;
1001 }
1002 }
1003
1004 if (!skb_queue_empty(&host->pending_packet_queue))
1005 mod_timer(&host->timeout, jiffies + host->timeout_interval);
1006
1007 spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
1008}
1009
1010
1011/* Kernel thread and vars, which handles packets that are completed. Only
1012 * packets that have a "complete" function are sent here. This way, the
1013 * completion is run out of kernel context, and doesn't block the rest of
1014 * the stack. */
1015static int khpsbpkt_pid = -1, khpsbpkt_kill;
1016static DECLARE_COMPLETION(khpsbpkt_complete);
1017static struct sk_buff_head hpsbpkt_queue;
1018static DECLARE_MUTEX_LOCKED(khpsbpkt_sig);
1019
1020
1021static void queue_packet_complete(struct hpsb_packet *packet)
1022{
1023 if (packet->no_waiter) {
1024 hpsb_free_packet(packet);
1025 return;
1026 }
1027 if (packet->complete_routine != NULL) {
1028 skb_queue_tail(&hpsbpkt_queue, packet->skb);
1029
1030 /* Signal the kernel thread to handle this */
1031 up(&khpsbpkt_sig);
1032 }
1033 return;
1034}
1035
1036static int hpsbpkt_thread(void *__hi)
1037{
1038 struct sk_buff *skb;
1039 struct hpsb_packet *packet;
1040 void (*complete_routine)(void*);
1041 void *complete_data;
1042
1043 daemonize("khpsbpkt");
1044
1045 while (1) {
1046 if (down_interruptible(&khpsbpkt_sig)) {
Christoph Lameter3e1d1d22005-06-24 23:13:50 -07001047 if (try_to_freeze())
Linus Torvalds1da177e2005-04-16 15:20:36 -07001048 continue;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001049 printk("khpsbpkt: received unexpected signal?!\n" );
1050 break;
1051 }
1052
1053 if (khpsbpkt_kill)
1054 break;
1055
1056 while ((skb = skb_dequeue(&hpsbpkt_queue)) != NULL) {
1057 packet = (struct hpsb_packet *)skb->data;
1058
1059 complete_routine = packet->complete_routine;
1060 complete_data = packet->complete_data;
1061
1062 packet->complete_routine = packet->complete_data = NULL;
1063
1064 complete_routine(complete_data);
1065 }
1066 }
1067
1068 complete_and_exit(&khpsbpkt_complete, 0);
1069}
1070
1071static int __init ieee1394_init(void)
1072{
1073 int i, ret;
1074
1075 skb_queue_head_init(&hpsbpkt_queue);
1076
1077 /* non-fatal error */
1078 if (hpsb_init_config_roms()) {
1079 HPSB_ERR("Failed to initialize some config rom entries.\n");
1080 HPSB_ERR("Some features may not be available\n");
1081 }
1082
1083 khpsbpkt_pid = kernel_thread(hpsbpkt_thread, NULL, CLONE_KERNEL);
1084 if (khpsbpkt_pid < 0) {
1085 HPSB_ERR("Failed to start hpsbpkt thread!\n");
1086 ret = -ENOMEM;
1087 goto exit_cleanup_config_roms;
1088 }
1089
1090 if (register_chrdev_region(IEEE1394_CORE_DEV, 256, "ieee1394")) {
1091 HPSB_ERR("unable to register character device major %d!\n", IEEE1394_MAJOR);
1092 ret = -ENODEV;
1093 goto exit_release_kernel_thread;
1094 }
1095
1096 /* actually this is a non-fatal error */
1097 ret = devfs_mk_dir("ieee1394");
1098 if (ret < 0) {
1099 HPSB_ERR("unable to make devfs dir for device major %d!\n", IEEE1394_MAJOR);
1100 goto release_chrdev;
1101 }
1102
1103 ret = bus_register(&ieee1394_bus_type);
1104 if (ret < 0) {
1105 HPSB_INFO("bus register failed");
1106 goto release_devfs;
1107 }
1108
1109 for (i = 0; fw_bus_attrs[i]; i++) {
1110 ret = bus_create_file(&ieee1394_bus_type, fw_bus_attrs[i]);
1111 if (ret < 0) {
1112 while (i >= 0) {
1113 bus_remove_file(&ieee1394_bus_type,
1114 fw_bus_attrs[i--]);
1115 }
1116 bus_unregister(&ieee1394_bus_type);
1117 goto release_devfs;
1118 }
1119 }
1120
1121 ret = class_register(&hpsb_host_class);
1122 if (ret < 0)
1123 goto release_all_bus;
1124
gregkh@suse.de7e25ab92005-03-23 09:53:36 -08001125 hpsb_protocol_class = class_create(THIS_MODULE, "ieee1394_protocol");
Linus Torvalds1da177e2005-04-16 15:20:36 -07001126 if (IS_ERR(hpsb_protocol_class)) {
1127 ret = PTR_ERR(hpsb_protocol_class);
1128 goto release_class_host;
1129 }
1130
1131 ret = init_csr();
1132 if (ret) {
1133 HPSB_INFO("init csr failed");
1134 ret = -ENOMEM;
1135 goto release_class_protocol;
1136 }
1137
1138 if (disable_nodemgr) {
1139 HPSB_INFO("nodemgr and IRM functionality disabled");
1140 /* We shouldn't contend for IRM with nodemgr disabled, since
1141 nodemgr implements functionality required of ieee1394a-2000
1142 IRMs */
1143 hpsb_disable_irm = 1;
1144
1145 return 0;
1146 }
1147
1148 if (hpsb_disable_irm) {
1149 HPSB_INFO("IRM functionality disabled");
1150 }
1151
1152 ret = init_ieee1394_nodemgr();
1153 if (ret < 0) {
1154 HPSB_INFO("init nodemgr failed");
1155 goto cleanup_csr;
1156 }
1157
1158 return 0;
1159
1160cleanup_csr:
1161 cleanup_csr();
1162release_class_protocol:
gregkh@suse.de7e25ab92005-03-23 09:53:36 -08001163 class_destroy(hpsb_protocol_class);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001164release_class_host:
1165 class_unregister(&hpsb_host_class);
1166release_all_bus:
1167 for (i = 0; fw_bus_attrs[i]; i++)
1168 bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
1169 bus_unregister(&ieee1394_bus_type);
1170release_devfs:
1171 devfs_remove("ieee1394");
1172release_chrdev:
1173 unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
1174exit_release_kernel_thread:
1175 if (khpsbpkt_pid >= 0) {
1176 kill_proc(khpsbpkt_pid, SIGTERM, 1);
1177 wait_for_completion(&khpsbpkt_complete);
1178 }
1179exit_cleanup_config_roms:
1180 hpsb_cleanup_config_roms();
1181 return ret;
1182}
1183
1184static void __exit ieee1394_cleanup(void)
1185{
1186 int i;
1187
1188 if (!disable_nodemgr)
1189 cleanup_ieee1394_nodemgr();
1190
1191 cleanup_csr();
1192
gregkh@suse.de7e25ab92005-03-23 09:53:36 -08001193 class_destroy(hpsb_protocol_class);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001194 class_unregister(&hpsb_host_class);
1195 for (i = 0; fw_bus_attrs[i]; i++)
1196 bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
1197 bus_unregister(&ieee1394_bus_type);
1198
1199 if (khpsbpkt_pid >= 0) {
1200 khpsbpkt_kill = 1;
1201 mb();
1202 up(&khpsbpkt_sig);
1203 wait_for_completion(&khpsbpkt_complete);
1204 }
1205
1206 hpsb_cleanup_config_roms();
1207
1208 unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
1209 devfs_remove("ieee1394");
1210}
1211
1212module_init(ieee1394_init);
1213module_exit(ieee1394_cleanup);
1214
1215/* Exported symbols */
1216
1217/** hosts.c **/
1218EXPORT_SYMBOL(hpsb_alloc_host);
1219EXPORT_SYMBOL(hpsb_add_host);
1220EXPORT_SYMBOL(hpsb_remove_host);
1221EXPORT_SYMBOL(hpsb_update_config_rom_image);
1222
1223/** ieee1394_core.c **/
1224EXPORT_SYMBOL(hpsb_speedto_str);
1225EXPORT_SYMBOL(hpsb_protocol_class);
1226EXPORT_SYMBOL(hpsb_set_packet_complete_task);
1227EXPORT_SYMBOL(hpsb_alloc_packet);
1228EXPORT_SYMBOL(hpsb_free_packet);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001229EXPORT_SYMBOL(hpsb_send_packet);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001230EXPORT_SYMBOL(hpsb_reset_bus);
1231EXPORT_SYMBOL(hpsb_bus_reset);
1232EXPORT_SYMBOL(hpsb_selfid_received);
1233EXPORT_SYMBOL(hpsb_selfid_complete);
1234EXPORT_SYMBOL(hpsb_packet_sent);
1235EXPORT_SYMBOL(hpsb_packet_received);
1236EXPORT_SYMBOL_GPL(hpsb_disable_irm);
Ben Collins1934b8b2005-07-09 20:01:23 -04001237#ifdef CONFIG_IEEE1394_EXPORT_FULL_API
1238EXPORT_SYMBOL(hpsb_send_phy_config);
1239EXPORT_SYMBOL(hpsb_send_packet_and_wait);
1240#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001241
1242/** ieee1394_transactions.c **/
1243EXPORT_SYMBOL(hpsb_get_tlabel);
1244EXPORT_SYMBOL(hpsb_free_tlabel);
1245EXPORT_SYMBOL(hpsb_make_readpacket);
1246EXPORT_SYMBOL(hpsb_make_writepacket);
1247EXPORT_SYMBOL(hpsb_make_streampacket);
1248EXPORT_SYMBOL(hpsb_make_lockpacket);
1249EXPORT_SYMBOL(hpsb_make_lock64packet);
1250EXPORT_SYMBOL(hpsb_make_phypacket);
1251EXPORT_SYMBOL(hpsb_make_isopacket);
1252EXPORT_SYMBOL(hpsb_read);
1253EXPORT_SYMBOL(hpsb_write);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001254EXPORT_SYMBOL(hpsb_packet_success);
1255
1256/** highlevel.c **/
1257EXPORT_SYMBOL(hpsb_register_highlevel);
1258EXPORT_SYMBOL(hpsb_unregister_highlevel);
1259EXPORT_SYMBOL(hpsb_register_addrspace);
1260EXPORT_SYMBOL(hpsb_unregister_addrspace);
1261EXPORT_SYMBOL(hpsb_allocate_and_register_addrspace);
1262EXPORT_SYMBOL(hpsb_listen_channel);
1263EXPORT_SYMBOL(hpsb_unlisten_channel);
1264EXPORT_SYMBOL(hpsb_get_hostinfo);
1265EXPORT_SYMBOL(hpsb_create_hostinfo);
1266EXPORT_SYMBOL(hpsb_destroy_hostinfo);
1267EXPORT_SYMBOL(hpsb_set_hostinfo_key);
1268EXPORT_SYMBOL(hpsb_get_hostinfo_bykey);
1269EXPORT_SYMBOL(hpsb_set_hostinfo);
Ben Collins1934b8b2005-07-09 20:01:23 -04001270EXPORT_SYMBOL(highlevel_host_reset);
1271#ifdef CONFIG_IEEE1394_EXPORT_FULL_API
Linus Torvalds1da177e2005-04-16 15:20:36 -07001272EXPORT_SYMBOL(highlevel_add_host);
1273EXPORT_SYMBOL(highlevel_remove_host);
Ben Collins1934b8b2005-07-09 20:01:23 -04001274#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001275
1276/** nodemgr.c **/
1277EXPORT_SYMBOL(hpsb_node_fill_packet);
1278EXPORT_SYMBOL(hpsb_node_write);
1279EXPORT_SYMBOL(hpsb_register_protocol);
1280EXPORT_SYMBOL(hpsb_unregister_protocol);
1281EXPORT_SYMBOL(ieee1394_bus_type);
Ben Collins1934b8b2005-07-09 20:01:23 -04001282#ifdef CONFIG_IEEE1394_EXPORT_FULL_API
Linus Torvalds1da177e2005-04-16 15:20:36 -07001283EXPORT_SYMBOL(nodemgr_for_each_host);
Ben Collins1934b8b2005-07-09 20:01:23 -04001284#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001285
1286/** csr.c **/
1287EXPORT_SYMBOL(hpsb_update_config_rom);
1288
1289/** dma.c **/
1290EXPORT_SYMBOL(dma_prog_region_init);
1291EXPORT_SYMBOL(dma_prog_region_alloc);
1292EXPORT_SYMBOL(dma_prog_region_free);
1293EXPORT_SYMBOL(dma_region_init);
1294EXPORT_SYMBOL(dma_region_alloc);
1295EXPORT_SYMBOL(dma_region_free);
1296EXPORT_SYMBOL(dma_region_sync_for_cpu);
1297EXPORT_SYMBOL(dma_region_sync_for_device);
1298EXPORT_SYMBOL(dma_region_mmap);
1299EXPORT_SYMBOL(dma_region_offset_to_bus);
1300
1301/** iso.c **/
1302EXPORT_SYMBOL(hpsb_iso_xmit_init);
1303EXPORT_SYMBOL(hpsb_iso_recv_init);
1304EXPORT_SYMBOL(hpsb_iso_xmit_start);
1305EXPORT_SYMBOL(hpsb_iso_recv_start);
1306EXPORT_SYMBOL(hpsb_iso_recv_listen_channel);
1307EXPORT_SYMBOL(hpsb_iso_recv_unlisten_channel);
1308EXPORT_SYMBOL(hpsb_iso_recv_set_channel_mask);
1309EXPORT_SYMBOL(hpsb_iso_stop);
1310EXPORT_SYMBOL(hpsb_iso_shutdown);
1311EXPORT_SYMBOL(hpsb_iso_xmit_queue_packet);
1312EXPORT_SYMBOL(hpsb_iso_xmit_sync);
1313EXPORT_SYMBOL(hpsb_iso_recv_release_packets);
1314EXPORT_SYMBOL(hpsb_iso_n_ready);
1315EXPORT_SYMBOL(hpsb_iso_packet_sent);
1316EXPORT_SYMBOL(hpsb_iso_packet_received);
1317EXPORT_SYMBOL(hpsb_iso_wake);
1318EXPORT_SYMBOL(hpsb_iso_recv_flush);
1319
1320/** csr1212.c **/
Ben Collins1934b8b2005-07-09 20:01:23 -04001321EXPORT_SYMBOL(csr1212_new_directory);
1322EXPORT_SYMBOL(csr1212_attach_keyval_to_directory);
1323EXPORT_SYMBOL(csr1212_detach_keyval_from_directory);
1324EXPORT_SYMBOL(csr1212_release_keyval);
1325EXPORT_SYMBOL(csr1212_read);
1326EXPORT_SYMBOL(csr1212_parse_keyval);
1327EXPORT_SYMBOL(_csr1212_read_keyval);
1328EXPORT_SYMBOL(_csr1212_destroy_keyval);
1329#ifdef CONFIG_IEEE1394_EXPORT_FULL_API
Linus Torvalds1da177e2005-04-16 15:20:36 -07001330EXPORT_SYMBOL(csr1212_create_csr);
1331EXPORT_SYMBOL(csr1212_init_local_csr);
1332EXPORT_SYMBOL(csr1212_new_immediate);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001333EXPORT_SYMBOL(csr1212_associate_keyval);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001334EXPORT_SYMBOL(csr1212_new_string_descriptor_leaf);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001335EXPORT_SYMBOL(csr1212_destroy_csr);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001336EXPORT_SYMBOL(csr1212_generate_csr_image);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001337EXPORT_SYMBOL(csr1212_parse_csr);
Ben Collins1934b8b2005-07-09 20:01:23 -04001338#endif