ieee1394_core.c 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. /*
  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. #include <linux/kernel.h>
  23. #include <linux/list.h>
  24. #include <linux/string.h>
  25. #include <linux/init.h>
  26. #include <linux/slab.h>
  27. #include <linux/interrupt.h>
  28. #include <linux/module.h>
  29. #include <linux/moduleparam.h>
  30. #include <linux/bitops.h>
  31. #include <linux/kdev_t.h>
  32. #include <linux/skbuff.h>
  33. #include <linux/suspend.h>
  34. #include <linux/kthread.h>
  35. #include <asm/byteorder.h>
  36. #include "ieee1394_types.h"
  37. #include "ieee1394.h"
  38. #include "hosts.h"
  39. #include "ieee1394_core.h"
  40. #include "highlevel.h"
  41. #include "ieee1394_transactions.h"
  42. #include "csr.h"
  43. #include "nodemgr.h"
  44. #include "dma.h"
  45. #include "iso.h"
  46. #include "config_roms.h"
  47. /*
  48. * Disable the nodemgr detection and config rom reading functionality.
  49. */
  50. static int disable_nodemgr;
  51. module_param(disable_nodemgr, int, 0444);
  52. MODULE_PARM_DESC(disable_nodemgr, "Disable nodemgr functionality.");
  53. /* Disable Isochronous Resource Manager functionality */
  54. int hpsb_disable_irm = 0;
  55. module_param_named(disable_irm, hpsb_disable_irm, bool, 0444);
  56. MODULE_PARM_DESC(disable_irm,
  57. "Disable Isochronous Resource Manager functionality.");
  58. /* We are GPL, so treat us special */
  59. MODULE_LICENSE("GPL");
  60. /* Some globals used */
  61. const char *hpsb_speedto_str[] = { "S100", "S200", "S400", "S800", "S1600", "S3200" };
  62. struct class *hpsb_protocol_class;
  63. #ifdef CONFIG_IEEE1394_VERBOSEDEBUG
  64. static void dump_packet(const char *text, quadlet_t *data, int size, int speed)
  65. {
  66. int i;
  67. size /= 4;
  68. size = (size > 4 ? 4 : size);
  69. printk(KERN_DEBUG "ieee1394: %s", text);
  70. if (speed > -1 && speed < 6)
  71. printk(" at %s", hpsb_speedto_str[speed]);
  72. printk(":");
  73. for (i = 0; i < size; i++)
  74. printk(" %08x", data[i]);
  75. printk("\n");
  76. }
  77. #else
  78. #define dump_packet(a,b,c,d) do {} while (0)
  79. #endif
  80. static void abort_requests(struct hpsb_host *host);
  81. static void queue_packet_complete(struct hpsb_packet *packet);
  82. /**
  83. * hpsb_set_packet_complete_task - set the task that runs when a packet
  84. * completes. You cannot call this more than once on a single packet
  85. * before it is sent.
  86. *
  87. * @packet: the packet whose completion we want the task added to
  88. * @routine: function to call
  89. * @data: data (if any) to pass to the above function
  90. */
  91. void hpsb_set_packet_complete_task(struct hpsb_packet *packet,
  92. void (*routine)(void *), void *data)
  93. {
  94. WARN_ON(packet->complete_routine != NULL);
  95. packet->complete_routine = routine;
  96. packet->complete_data = data;
  97. return;
  98. }
  99. /**
  100. * hpsb_alloc_packet - allocate new packet structure
  101. * @data_size: size of the data block to be allocated
  102. *
  103. * This function allocates, initializes and returns a new &struct hpsb_packet.
  104. * It can be used in interrupt context. A header block is always included, its
  105. * size is big enough to contain all possible 1394 headers. The data block is
  106. * only allocated when @data_size is not zero.
  107. *
  108. * For packets for which responses will be received the @data_size has to be big
  109. * enough to contain the response's data block since no further allocation
  110. * occurs at response matching time.
  111. *
  112. * The packet's generation value will be set to the current generation number
  113. * for ease of use. Remember to overwrite it with your own recorded generation
  114. * number if you can not be sure that your code will not race with a bus reset.
  115. *
  116. * Return value: A pointer to a &struct hpsb_packet or NULL on allocation
  117. * failure.
  118. */
  119. struct hpsb_packet *hpsb_alloc_packet(size_t data_size)
  120. {
  121. struct hpsb_packet *packet = NULL;
  122. struct sk_buff *skb;
  123. data_size = ((data_size + 3) & ~3);
  124. skb = alloc_skb(data_size + sizeof(*packet), GFP_ATOMIC);
  125. if (skb == NULL)
  126. return NULL;
  127. memset(skb->data, 0, data_size + sizeof(*packet));
  128. packet = (struct hpsb_packet *)skb->data;
  129. packet->skb = skb;
  130. packet->header = packet->embedded_header;
  131. packet->state = hpsb_unused;
  132. packet->generation = -1;
  133. INIT_LIST_HEAD(&packet->driver_list);
  134. atomic_set(&packet->refcnt, 1);
  135. if (data_size) {
  136. packet->data = (quadlet_t *)(skb->data + sizeof(*packet));
  137. packet->data_size = data_size;
  138. }
  139. return packet;
  140. }
  141. /**
  142. * hpsb_free_packet - free packet and data associated with it
  143. * @packet: packet to free (is NULL safe)
  144. *
  145. * This function will free packet->data and finally the packet itself.
  146. */
  147. void hpsb_free_packet(struct hpsb_packet *packet)
  148. {
  149. if (packet && atomic_dec_and_test(&packet->refcnt)) {
  150. BUG_ON(!list_empty(&packet->driver_list));
  151. kfree_skb(packet->skb);
  152. }
  153. }
  154. int hpsb_reset_bus(struct hpsb_host *host, int type)
  155. {
  156. if (!host->in_bus_reset) {
  157. host->driver->devctl(host, RESET_BUS, type);
  158. return 0;
  159. } else {
  160. return 1;
  161. }
  162. }
  163. int hpsb_bus_reset(struct hpsb_host *host)
  164. {
  165. if (host->in_bus_reset) {
  166. HPSB_NOTICE("%s called while bus reset already in progress",
  167. __FUNCTION__);
  168. return 1;
  169. }
  170. abort_requests(host);
  171. host->in_bus_reset = 1;
  172. host->irm_id = -1;
  173. host->is_irm = 0;
  174. host->busmgr_id = -1;
  175. host->is_busmgr = 0;
  176. host->is_cycmst = 0;
  177. host->node_count = 0;
  178. host->selfid_count = 0;
  179. return 0;
  180. }
  181. /*
  182. * Verify num_of_selfids SelfIDs and return number of nodes. Return zero in
  183. * case verification failed.
  184. */
  185. static int check_selfids(struct hpsb_host *host)
  186. {
  187. int nodeid = -1;
  188. int rest_of_selfids = host->selfid_count;
  189. struct selfid *sid = (struct selfid *)host->topology_map;
  190. struct ext_selfid *esid;
  191. int esid_seq = 23;
  192. host->nodes_active = 0;
  193. while (rest_of_selfids--) {
  194. if (!sid->extended) {
  195. nodeid++;
  196. esid_seq = 0;
  197. if (sid->phy_id != nodeid) {
  198. HPSB_INFO("SelfIDs failed monotony check with "
  199. "%d", sid->phy_id);
  200. return 0;
  201. }
  202. if (sid->link_active) {
  203. host->nodes_active++;
  204. if (sid->contender)
  205. host->irm_id = LOCAL_BUS | sid->phy_id;
  206. }
  207. } else {
  208. esid = (struct ext_selfid *)sid;
  209. if ((esid->phy_id != nodeid)
  210. || (esid->seq_nr != esid_seq)) {
  211. HPSB_INFO("SelfIDs failed monotony check with "
  212. "%d/%d", esid->phy_id, esid->seq_nr);
  213. return 0;
  214. }
  215. esid_seq++;
  216. }
  217. sid++;
  218. }
  219. esid = (struct ext_selfid *)(sid - 1);
  220. while (esid->extended) {
  221. if ((esid->porta == SELFID_PORT_PARENT) ||
  222. (esid->portb == SELFID_PORT_PARENT) ||
  223. (esid->portc == SELFID_PORT_PARENT) ||
  224. (esid->portd == SELFID_PORT_PARENT) ||
  225. (esid->porte == SELFID_PORT_PARENT) ||
  226. (esid->portf == SELFID_PORT_PARENT) ||
  227. (esid->portg == SELFID_PORT_PARENT) ||
  228. (esid->porth == SELFID_PORT_PARENT)) {
  229. HPSB_INFO("SelfIDs failed root check on "
  230. "extended SelfID");
  231. return 0;
  232. }
  233. esid--;
  234. }
  235. sid = (struct selfid *)esid;
  236. if ((sid->port0 == SELFID_PORT_PARENT) ||
  237. (sid->port1 == SELFID_PORT_PARENT) ||
  238. (sid->port2 == SELFID_PORT_PARENT)) {
  239. HPSB_INFO("SelfIDs failed root check");
  240. return 0;
  241. }
  242. host->node_count = nodeid + 1;
  243. return 1;
  244. }
  245. static void build_speed_map(struct hpsb_host *host, int nodecount)
  246. {
  247. u8 cldcnt[nodecount];
  248. u8 *map = host->speed_map;
  249. u8 *speedcap = host->speed;
  250. struct selfid *sid;
  251. struct ext_selfid *esid;
  252. int i, j, n;
  253. for (i = 0; i < (nodecount * 64); i += 64) {
  254. for (j = 0; j < nodecount; j++) {
  255. map[i+j] = IEEE1394_SPEED_MAX;
  256. }
  257. }
  258. for (i = 0; i < nodecount; i++) {
  259. cldcnt[i] = 0;
  260. }
  261. /* find direct children count and speed */
  262. for (sid = (struct selfid *)&host->topology_map[host->selfid_count-1],
  263. n = nodecount - 1;
  264. (void *)sid >= (void *)host->topology_map; sid--) {
  265. if (sid->extended) {
  266. esid = (struct ext_selfid *)sid;
  267. if (esid->porta == SELFID_PORT_CHILD) cldcnt[n]++;
  268. if (esid->portb == SELFID_PORT_CHILD) cldcnt[n]++;
  269. if (esid->portc == SELFID_PORT_CHILD) cldcnt[n]++;
  270. if (esid->portd == SELFID_PORT_CHILD) cldcnt[n]++;
  271. if (esid->porte == SELFID_PORT_CHILD) cldcnt[n]++;
  272. if (esid->portf == SELFID_PORT_CHILD) cldcnt[n]++;
  273. if (esid->portg == SELFID_PORT_CHILD) cldcnt[n]++;
  274. if (esid->porth == SELFID_PORT_CHILD) cldcnt[n]++;
  275. } else {
  276. if (sid->port0 == SELFID_PORT_CHILD) cldcnt[n]++;
  277. if (sid->port1 == SELFID_PORT_CHILD) cldcnt[n]++;
  278. if (sid->port2 == SELFID_PORT_CHILD) cldcnt[n]++;
  279. speedcap[n] = sid->speed;
  280. n--;
  281. }
  282. }
  283. /* set self mapping */
  284. for (i = 0; i < nodecount; i++) {
  285. map[64*i + i] = speedcap[i];
  286. }
  287. /* fix up direct children count to total children count;
  288. * also fix up speedcaps for sibling and parent communication */
  289. for (i = 1; i < nodecount; i++) {
  290. for (j = cldcnt[i], n = i - 1; j > 0; j--) {
  291. cldcnt[i] += cldcnt[n];
  292. speedcap[n] = min(speedcap[n], speedcap[i]);
  293. n -= cldcnt[n] + 1;
  294. }
  295. }
  296. for (n = 0; n < nodecount; n++) {
  297. for (i = n - cldcnt[n]; i <= n; i++) {
  298. for (j = 0; j < (n - cldcnt[n]); j++) {
  299. map[j*64 + i] = map[i*64 + j] =
  300. min(map[i*64 + j], speedcap[n]);
  301. }
  302. for (j = n + 1; j < nodecount; j++) {
  303. map[j*64 + i] = map[i*64 + j] =
  304. min(map[i*64 + j], speedcap[n]);
  305. }
  306. }
  307. }
  308. #if SELFID_SPEED_UNKNOWN != IEEE1394_SPEED_MAX
  309. /* assume maximum speed for 1394b PHYs, nodemgr will correct it */
  310. for (n = 0; n < nodecount; n++)
  311. if (speedcap[n] == SELFID_SPEED_UNKNOWN)
  312. speedcap[n] = IEEE1394_SPEED_MAX;
  313. #endif
  314. }
  315. void hpsb_selfid_received(struct hpsb_host *host, quadlet_t sid)
  316. {
  317. if (host->in_bus_reset) {
  318. HPSB_VERBOSE("Including SelfID 0x%x", sid);
  319. host->topology_map[host->selfid_count++] = sid;
  320. } else {
  321. HPSB_NOTICE("Spurious SelfID packet (0x%08x) received from bus %d",
  322. sid, NODEID_TO_BUS(host->node_id));
  323. }
  324. }
  325. void hpsb_selfid_complete(struct hpsb_host *host, int phyid, int isroot)
  326. {
  327. if (!host->in_bus_reset)
  328. HPSB_NOTICE("SelfID completion called outside of bus reset!");
  329. host->node_id = LOCAL_BUS | phyid;
  330. host->is_root = isroot;
  331. if (!check_selfids(host)) {
  332. if (host->reset_retries++ < 20) {
  333. /* selfid stage did not complete without error */
  334. HPSB_NOTICE("Error in SelfID stage, resetting");
  335. host->in_bus_reset = 0;
  336. /* this should work from ohci1394 now... */
  337. hpsb_reset_bus(host, LONG_RESET);
  338. return;
  339. } else {
  340. HPSB_NOTICE("Stopping out-of-control reset loop");
  341. HPSB_NOTICE("Warning - topology map and speed map will not be valid");
  342. host->reset_retries = 0;
  343. }
  344. } else {
  345. host->reset_retries = 0;
  346. build_speed_map(host, host->node_count);
  347. }
  348. HPSB_VERBOSE("selfid_complete called with successful SelfID stage "
  349. "... irm_id: 0x%X node_id: 0x%X",host->irm_id,host->node_id);
  350. /* irm_id is kept up to date by check_selfids() */
  351. if (host->irm_id == host->node_id) {
  352. host->is_irm = 1;
  353. } else {
  354. host->is_busmgr = 0;
  355. host->is_irm = 0;
  356. }
  357. if (isroot) {
  358. host->driver->devctl(host, ACT_CYCLE_MASTER, 1);
  359. host->is_cycmst = 1;
  360. }
  361. atomic_inc(&host->generation);
  362. host->in_bus_reset = 0;
  363. highlevel_host_reset(host);
  364. }
  365. void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet,
  366. int ackcode)
  367. {
  368. unsigned long flags;
  369. spin_lock_irqsave(&host->pending_packet_queue.lock, flags);
  370. packet->ack_code = ackcode;
  371. if (packet->no_waiter || packet->state == hpsb_complete) {
  372. /* if packet->no_waiter, must not have a tlabel allocated */
  373. spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
  374. hpsb_free_packet(packet);
  375. return;
  376. }
  377. atomic_dec(&packet->refcnt); /* drop HC's reference */
  378. /* here the packet must be on the host->pending_packet_queue */
  379. if (ackcode != ACK_PENDING || !packet->expect_response) {
  380. packet->state = hpsb_complete;
  381. __skb_unlink(packet->skb, &host->pending_packet_queue);
  382. spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
  383. queue_packet_complete(packet);
  384. return;
  385. }
  386. packet->state = hpsb_pending;
  387. packet->sendtime = jiffies;
  388. spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
  389. mod_timer(&host->timeout, jiffies + host->timeout_interval);
  390. }
  391. /**
  392. * hpsb_send_phy_config - transmit a PHY configuration packet on the bus
  393. * @host: host that PHY config packet gets sent through
  394. * @rootid: root whose force_root bit should get set (-1 = don't set force_root)
  395. * @gapcnt: gap count value to set (-1 = don't set gap count)
  396. *
  397. * This function sends a PHY config packet on the bus through the specified host.
  398. *
  399. * Return value: 0 for success or error number otherwise.
  400. */
  401. int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt)
  402. {
  403. struct hpsb_packet *packet;
  404. quadlet_t d = 0;
  405. int retval = 0;
  406. if (rootid >= ALL_NODES || rootid < -1 || gapcnt > 0x3f || gapcnt < -1 ||
  407. (rootid == -1 && gapcnt == -1)) {
  408. HPSB_DEBUG("Invalid Parameter: rootid = %d gapcnt = %d",
  409. rootid, gapcnt);
  410. return -EINVAL;
  411. }
  412. if (rootid != -1)
  413. d |= PHYPACKET_PHYCONFIG_R | rootid << PHYPACKET_PORT_SHIFT;
  414. if (gapcnt != -1)
  415. d |= PHYPACKET_PHYCONFIG_T | gapcnt << PHYPACKET_GAPCOUNT_SHIFT;
  416. packet = hpsb_make_phypacket(host, d);
  417. if (!packet)
  418. return -ENOMEM;
  419. packet->generation = get_hpsb_generation(host);
  420. retval = hpsb_send_packet_and_wait(packet);
  421. hpsb_free_packet(packet);
  422. return retval;
  423. }
  424. /**
  425. * hpsb_send_packet - transmit a packet on the bus
  426. * @packet: packet to send
  427. *
  428. * The packet is sent through the host specified in the packet->host field.
  429. * Before sending, the packet's transmit speed is automatically determined
  430. * using the local speed map when it is an async, non-broadcast packet.
  431. *
  432. * Possibilities for failure are that host is either not initialized, in bus
  433. * reset, the packet's generation number doesn't match the current generation
  434. * number or the host reports a transmit error.
  435. *
  436. * Return value: 0 on success, negative errno on failure.
  437. */
  438. int hpsb_send_packet(struct hpsb_packet *packet)
  439. {
  440. struct hpsb_host *host = packet->host;
  441. if (host->is_shutdown)
  442. return -EINVAL;
  443. if (host->in_bus_reset ||
  444. (packet->generation != get_hpsb_generation(host)))
  445. return -EAGAIN;
  446. packet->state = hpsb_queued;
  447. /* This just seems silly to me */
  448. WARN_ON(packet->no_waiter && packet->expect_response);
  449. if (!packet->no_waiter || packet->expect_response) {
  450. atomic_inc(&packet->refcnt);
  451. /* Set the initial "sendtime" to 10 seconds from now, to
  452. prevent premature expiry. If a packet takes more than
  453. 10 seconds to hit the wire, we have bigger problems :) */
  454. packet->sendtime = jiffies + 10 * HZ;
  455. skb_queue_tail(&host->pending_packet_queue, packet->skb);
  456. }
  457. if (packet->node_id == host->node_id) {
  458. /* it is a local request, so handle it locally */
  459. quadlet_t *data;
  460. size_t size = packet->data_size + packet->header_size;
  461. data = kmalloc(size, GFP_ATOMIC);
  462. if (!data) {
  463. HPSB_ERR("unable to allocate memory for concatenating header and data");
  464. return -ENOMEM;
  465. }
  466. memcpy(data, packet->header, packet->header_size);
  467. if (packet->data_size)
  468. memcpy(((u8*)data) + packet->header_size, packet->data, packet->data_size);
  469. dump_packet("send packet local", packet->header, packet->header_size, -1);
  470. hpsb_packet_sent(host, packet, packet->expect_response ? ACK_PENDING : ACK_COMPLETE);
  471. hpsb_packet_received(host, data, size, 0);
  472. kfree(data);
  473. return 0;
  474. }
  475. if (packet->type == hpsb_async &&
  476. NODEID_TO_NODE(packet->node_id) != ALL_NODES)
  477. packet->speed_code =
  478. host->speed[NODEID_TO_NODE(packet->node_id)];
  479. dump_packet("send packet", packet->header, packet->header_size, packet->speed_code);
  480. return host->driver->transmit_packet(host, packet);
  481. }
  482. /* We could just use complete() directly as the packet complete
  483. * callback, but this is more typesafe, in the sense that we get a
  484. * compiler error if the prototype for complete() changes. */
  485. static void complete_packet(void *data)
  486. {
  487. complete((struct completion *) data);
  488. }
  489. int hpsb_send_packet_and_wait(struct hpsb_packet *packet)
  490. {
  491. struct completion done;
  492. int retval;
  493. init_completion(&done);
  494. hpsb_set_packet_complete_task(packet, complete_packet, &done);
  495. retval = hpsb_send_packet(packet);
  496. if (retval == 0)
  497. wait_for_completion(&done);
  498. return retval;
  499. }
  500. static void send_packet_nocare(struct hpsb_packet *packet)
  501. {
  502. if (hpsb_send_packet(packet) < 0) {
  503. hpsb_free_packet(packet);
  504. }
  505. }
  506. static void handle_packet_response(struct hpsb_host *host, int tcode,
  507. quadlet_t *data, size_t size)
  508. {
  509. struct hpsb_packet *packet = NULL;
  510. struct sk_buff *skb;
  511. int tcode_match = 0;
  512. int tlabel;
  513. unsigned long flags;
  514. tlabel = (data[0] >> 10) & 0x3f;
  515. spin_lock_irqsave(&host->pending_packet_queue.lock, flags);
  516. skb_queue_walk(&host->pending_packet_queue, skb) {
  517. packet = (struct hpsb_packet *)skb->data;
  518. if ((packet->tlabel == tlabel)
  519. && (packet->node_id == (data[1] >> 16))){
  520. break;
  521. }
  522. packet = NULL;
  523. }
  524. if (packet == NULL) {
  525. HPSB_DEBUG("unsolicited response packet received - no tlabel match");
  526. dump_packet("contents", data, 16, -1);
  527. spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
  528. return;
  529. }
  530. switch (packet->tcode) {
  531. case TCODE_WRITEQ:
  532. case TCODE_WRITEB:
  533. if (tcode != TCODE_WRITE_RESPONSE)
  534. break;
  535. tcode_match = 1;
  536. memcpy(packet->header, data, 12);
  537. break;
  538. case TCODE_READQ:
  539. if (tcode != TCODE_READQ_RESPONSE)
  540. break;
  541. tcode_match = 1;
  542. memcpy(packet->header, data, 16);
  543. break;
  544. case TCODE_READB:
  545. if (tcode != TCODE_READB_RESPONSE)
  546. break;
  547. tcode_match = 1;
  548. BUG_ON(packet->skb->len - sizeof(*packet) < size - 16);
  549. memcpy(packet->header, data, 16);
  550. memcpy(packet->data, data + 4, size - 16);
  551. break;
  552. case TCODE_LOCK_REQUEST:
  553. if (tcode != TCODE_LOCK_RESPONSE)
  554. break;
  555. tcode_match = 1;
  556. size = min((size - 16), (size_t)8);
  557. BUG_ON(packet->skb->len - sizeof(*packet) < size);
  558. memcpy(packet->header, data, 16);
  559. memcpy(packet->data, data + 4, size);
  560. break;
  561. }
  562. if (!tcode_match) {
  563. spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
  564. HPSB_INFO("unsolicited response packet received - tcode mismatch");
  565. dump_packet("contents", data, 16, -1);
  566. return;
  567. }
  568. __skb_unlink(skb, &host->pending_packet_queue);
  569. if (packet->state == hpsb_queued) {
  570. packet->sendtime = jiffies;
  571. packet->ack_code = ACK_PENDING;
  572. }
  573. packet->state = hpsb_complete;
  574. spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
  575. queue_packet_complete(packet);
  576. }
  577. static struct hpsb_packet *create_reply_packet(struct hpsb_host *host,
  578. quadlet_t *data, size_t dsize)
  579. {
  580. struct hpsb_packet *p;
  581. p = hpsb_alloc_packet(dsize);
  582. if (unlikely(p == NULL)) {
  583. /* FIXME - send data_error response */
  584. return NULL;
  585. }
  586. p->type = hpsb_async;
  587. p->state = hpsb_unused;
  588. p->host = host;
  589. p->node_id = data[1] >> 16;
  590. p->tlabel = (data[0] >> 10) & 0x3f;
  591. p->no_waiter = 1;
  592. p->generation = get_hpsb_generation(host);
  593. if (dsize % 4)
  594. p->data[dsize / 4] = 0;
  595. return p;
  596. }
  597. #define PREP_ASYNC_HEAD_RCODE(tc) \
  598. packet->tcode = tc; \
  599. packet->header[0] = (packet->node_id << 16) | (packet->tlabel << 10) \
  600. | (1 << 8) | (tc << 4); \
  601. packet->header[1] = (packet->host->node_id << 16) | (rcode << 12); \
  602. packet->header[2] = 0
  603. static void fill_async_readquad_resp(struct hpsb_packet *packet, int rcode,
  604. quadlet_t data)
  605. {
  606. PREP_ASYNC_HEAD_RCODE(TCODE_READQ_RESPONSE);
  607. packet->header[3] = data;
  608. packet->header_size = 16;
  609. packet->data_size = 0;
  610. }
  611. static void fill_async_readblock_resp(struct hpsb_packet *packet, int rcode,
  612. int length)
  613. {
  614. if (rcode != RCODE_COMPLETE)
  615. length = 0;
  616. PREP_ASYNC_HEAD_RCODE(TCODE_READB_RESPONSE);
  617. packet->header[3] = length << 16;
  618. packet->header_size = 16;
  619. packet->data_size = length + (length % 4 ? 4 - (length % 4) : 0);
  620. }
  621. static void fill_async_write_resp(struct hpsb_packet *packet, int rcode)
  622. {
  623. PREP_ASYNC_HEAD_RCODE(TCODE_WRITE_RESPONSE);
  624. packet->header[2] = 0;
  625. packet->header_size = 12;
  626. packet->data_size = 0;
  627. }
  628. static void fill_async_lock_resp(struct hpsb_packet *packet, int rcode, int extcode,
  629. int length)
  630. {
  631. if (rcode != RCODE_COMPLETE)
  632. length = 0;
  633. PREP_ASYNC_HEAD_RCODE(TCODE_LOCK_RESPONSE);
  634. packet->header[3] = (length << 16) | extcode;
  635. packet->header_size = 16;
  636. packet->data_size = length;
  637. }
  638. #define PREP_REPLY_PACKET(length) \
  639. packet = create_reply_packet(host, data, length); \
  640. if (packet == NULL) break
  641. static void handle_incoming_packet(struct hpsb_host *host, int tcode,
  642. quadlet_t *data, size_t size, int write_acked)
  643. {
  644. struct hpsb_packet *packet;
  645. int length, rcode, extcode;
  646. quadlet_t buffer;
  647. nodeid_t source = data[1] >> 16;
  648. nodeid_t dest = data[0] >> 16;
  649. u16 flags = (u16) data[0];
  650. u64 addr;
  651. /* big FIXME - no error checking is done for an out of bounds length */
  652. switch (tcode) {
  653. case TCODE_WRITEQ:
  654. addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
  655. rcode = highlevel_write(host, source, dest, data+3,
  656. addr, 4, flags);
  657. if (!write_acked
  658. && (NODEID_TO_NODE(data[0] >> 16) != NODE_MASK)
  659. && (rcode >= 0)) {
  660. /* not a broadcast write, reply */
  661. PREP_REPLY_PACKET(0);
  662. fill_async_write_resp(packet, rcode);
  663. send_packet_nocare(packet);
  664. }
  665. break;
  666. case TCODE_WRITEB:
  667. addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
  668. rcode = highlevel_write(host, source, dest, data+4,
  669. addr, data[3]>>16, flags);
  670. if (!write_acked
  671. && (NODEID_TO_NODE(data[0] >> 16) != NODE_MASK)
  672. && (rcode >= 0)) {
  673. /* not a broadcast write, reply */
  674. PREP_REPLY_PACKET(0);
  675. fill_async_write_resp(packet, rcode);
  676. send_packet_nocare(packet);
  677. }
  678. break;
  679. case TCODE_READQ:
  680. addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
  681. rcode = highlevel_read(host, source, &buffer, addr, 4, flags);
  682. if (rcode >= 0) {
  683. PREP_REPLY_PACKET(0);
  684. fill_async_readquad_resp(packet, rcode, buffer);
  685. send_packet_nocare(packet);
  686. }
  687. break;
  688. case TCODE_READB:
  689. length = data[3] >> 16;
  690. PREP_REPLY_PACKET(length);
  691. addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
  692. rcode = highlevel_read(host, source, packet->data, addr,
  693. length, flags);
  694. if (rcode >= 0) {
  695. fill_async_readblock_resp(packet, rcode, length);
  696. send_packet_nocare(packet);
  697. } else {
  698. hpsb_free_packet(packet);
  699. }
  700. break;
  701. case TCODE_LOCK_REQUEST:
  702. length = data[3] >> 16;
  703. extcode = data[3] & 0xffff;
  704. addr = (((u64)(data[1] & 0xffff)) << 32) | data[2];
  705. PREP_REPLY_PACKET(8);
  706. if ((extcode == 0) || (extcode >= 7)) {
  707. /* let switch default handle error */
  708. length = 0;
  709. }
  710. switch (length) {
  711. case 4:
  712. rcode = highlevel_lock(host, source, packet->data, addr,
  713. data[4], 0, extcode,flags);
  714. fill_async_lock_resp(packet, rcode, extcode, 4);
  715. break;
  716. case 8:
  717. if ((extcode != EXTCODE_FETCH_ADD)
  718. && (extcode != EXTCODE_LITTLE_ADD)) {
  719. rcode = highlevel_lock(host, source,
  720. packet->data, addr,
  721. data[5], data[4],
  722. extcode, flags);
  723. fill_async_lock_resp(packet, rcode, extcode, 4);
  724. } else {
  725. rcode = highlevel_lock64(host, source,
  726. (octlet_t *)packet->data, addr,
  727. *(octlet_t *)(data + 4), 0ULL,
  728. extcode, flags);
  729. fill_async_lock_resp(packet, rcode, extcode, 8);
  730. }
  731. break;
  732. case 16:
  733. rcode = highlevel_lock64(host, source,
  734. (octlet_t *)packet->data, addr,
  735. *(octlet_t *)(data + 6),
  736. *(octlet_t *)(data + 4),
  737. extcode, flags);
  738. fill_async_lock_resp(packet, rcode, extcode, 8);
  739. break;
  740. default:
  741. rcode = RCODE_TYPE_ERROR;
  742. fill_async_lock_resp(packet, rcode,
  743. extcode, 0);
  744. }
  745. if (rcode >= 0) {
  746. send_packet_nocare(packet);
  747. } else {
  748. hpsb_free_packet(packet);
  749. }
  750. break;
  751. }
  752. }
  753. #undef PREP_REPLY_PACKET
  754. void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
  755. int write_acked)
  756. {
  757. int tcode;
  758. if (host->in_bus_reset) {
  759. HPSB_INFO("received packet during reset; ignoring");
  760. return;
  761. }
  762. dump_packet("received packet", data, size, -1);
  763. tcode = (data[0] >> 4) & 0xf;
  764. switch (tcode) {
  765. case TCODE_WRITE_RESPONSE:
  766. case TCODE_READQ_RESPONSE:
  767. case TCODE_READB_RESPONSE:
  768. case TCODE_LOCK_RESPONSE:
  769. handle_packet_response(host, tcode, data, size);
  770. break;
  771. case TCODE_WRITEQ:
  772. case TCODE_WRITEB:
  773. case TCODE_READQ:
  774. case TCODE_READB:
  775. case TCODE_LOCK_REQUEST:
  776. handle_incoming_packet(host, tcode, data, size, write_acked);
  777. break;
  778. case TCODE_ISO_DATA:
  779. highlevel_iso_receive(host, data, size);
  780. break;
  781. case TCODE_CYCLE_START:
  782. /* simply ignore this packet if it is passed on */
  783. break;
  784. default:
  785. HPSB_NOTICE("received packet with bogus transaction code %d",
  786. tcode);
  787. break;
  788. }
  789. }
  790. static void abort_requests(struct hpsb_host *host)
  791. {
  792. struct hpsb_packet *packet;
  793. struct sk_buff *skb;
  794. host->driver->devctl(host, CANCEL_REQUESTS, 0);
  795. while ((skb = skb_dequeue(&host->pending_packet_queue)) != NULL) {
  796. packet = (struct hpsb_packet *)skb->data;
  797. packet->state = hpsb_complete;
  798. packet->ack_code = ACKX_ABORTED;
  799. queue_packet_complete(packet);
  800. }
  801. }
  802. void abort_timedouts(unsigned long __opaque)
  803. {
  804. struct hpsb_host *host = (struct hpsb_host *)__opaque;
  805. unsigned long flags;
  806. struct hpsb_packet *packet;
  807. struct sk_buff *skb;
  808. unsigned long expire;
  809. spin_lock_irqsave(&host->csr.lock, flags);
  810. expire = host->csr.expire;
  811. spin_unlock_irqrestore(&host->csr.lock, flags);
  812. /* Hold the lock around this, since we aren't dequeuing all
  813. * packets, just ones we need. */
  814. spin_lock_irqsave(&host->pending_packet_queue.lock, flags);
  815. while (!skb_queue_empty(&host->pending_packet_queue)) {
  816. skb = skb_peek(&host->pending_packet_queue);
  817. packet = (struct hpsb_packet *)skb->data;
  818. if (time_before(packet->sendtime + expire, jiffies)) {
  819. __skb_unlink(skb, &host->pending_packet_queue);
  820. packet->state = hpsb_complete;
  821. packet->ack_code = ACKX_TIMEOUT;
  822. queue_packet_complete(packet);
  823. } else {
  824. /* Since packets are added to the tail, the oldest
  825. * ones are first, always. When we get to one that
  826. * isn't timed out, the rest aren't either. */
  827. break;
  828. }
  829. }
  830. if (!skb_queue_empty(&host->pending_packet_queue))
  831. mod_timer(&host->timeout, jiffies + host->timeout_interval);
  832. spin_unlock_irqrestore(&host->pending_packet_queue.lock, flags);
  833. }
  834. /* Kernel thread and vars, which handles packets that are completed. Only
  835. * packets that have a "complete" function are sent here. This way, the
  836. * completion is run out of kernel context, and doesn't block the rest of
  837. * the stack. */
  838. static struct task_struct *khpsbpkt_thread;
  839. static struct sk_buff_head hpsbpkt_queue;
  840. static void queue_packet_complete(struct hpsb_packet *packet)
  841. {
  842. if (packet->no_waiter) {
  843. hpsb_free_packet(packet);
  844. return;
  845. }
  846. if (packet->complete_routine != NULL) {
  847. skb_queue_tail(&hpsbpkt_queue, packet->skb);
  848. wake_up_process(khpsbpkt_thread);
  849. }
  850. return;
  851. }
  852. static int hpsbpkt_thread(void *__hi)
  853. {
  854. struct sk_buff *skb;
  855. struct hpsb_packet *packet;
  856. void (*complete_routine)(void*);
  857. void *complete_data;
  858. current->flags |= PF_NOFREEZE;
  859. while (!kthread_should_stop()) {
  860. while ((skb = skb_dequeue(&hpsbpkt_queue)) != NULL) {
  861. packet = (struct hpsb_packet *)skb->data;
  862. complete_routine = packet->complete_routine;
  863. complete_data = packet->complete_data;
  864. packet->complete_routine = packet->complete_data = NULL;
  865. complete_routine(complete_data);
  866. }
  867. set_current_state(TASK_INTERRUPTIBLE);
  868. if (!skb_peek(&hpsbpkt_queue))
  869. schedule();
  870. __set_current_state(TASK_RUNNING);
  871. }
  872. return 0;
  873. }
  874. static int __init ieee1394_init(void)
  875. {
  876. int i, ret;
  877. skb_queue_head_init(&hpsbpkt_queue);
  878. /* non-fatal error */
  879. if (hpsb_init_config_roms()) {
  880. HPSB_ERR("Failed to initialize some config rom entries.\n");
  881. HPSB_ERR("Some features may not be available\n");
  882. }
  883. khpsbpkt_thread = kthread_run(hpsbpkt_thread, NULL, "khpsbpkt");
  884. if (IS_ERR(khpsbpkt_thread)) {
  885. HPSB_ERR("Failed to start hpsbpkt thread!\n");
  886. ret = PTR_ERR(khpsbpkt_thread);
  887. goto exit_cleanup_config_roms;
  888. }
  889. if (register_chrdev_region(IEEE1394_CORE_DEV, 256, "ieee1394")) {
  890. HPSB_ERR("unable to register character device major %d!\n", IEEE1394_MAJOR);
  891. ret = -ENODEV;
  892. goto exit_release_kernel_thread;
  893. }
  894. ret = bus_register(&ieee1394_bus_type);
  895. if (ret < 0) {
  896. HPSB_INFO("bus register failed");
  897. goto release_chrdev;
  898. }
  899. for (i = 0; fw_bus_attrs[i]; i++) {
  900. ret = bus_create_file(&ieee1394_bus_type, fw_bus_attrs[i]);
  901. if (ret < 0) {
  902. while (i >= 0) {
  903. bus_remove_file(&ieee1394_bus_type,
  904. fw_bus_attrs[i--]);
  905. }
  906. bus_unregister(&ieee1394_bus_type);
  907. goto release_chrdev;
  908. }
  909. }
  910. ret = class_register(&hpsb_host_class);
  911. if (ret < 0)
  912. goto release_all_bus;
  913. hpsb_protocol_class = class_create(THIS_MODULE, "ieee1394_protocol");
  914. if (IS_ERR(hpsb_protocol_class)) {
  915. ret = PTR_ERR(hpsb_protocol_class);
  916. goto release_class_host;
  917. }
  918. ret = init_csr();
  919. if (ret) {
  920. HPSB_INFO("init csr failed");
  921. ret = -ENOMEM;
  922. goto release_class_protocol;
  923. }
  924. if (disable_nodemgr) {
  925. HPSB_INFO("nodemgr and IRM functionality disabled");
  926. /* We shouldn't contend for IRM with nodemgr disabled, since
  927. nodemgr implements functionality required of ieee1394a-2000
  928. IRMs */
  929. hpsb_disable_irm = 1;
  930. return 0;
  931. }
  932. if (hpsb_disable_irm) {
  933. HPSB_INFO("IRM functionality disabled");
  934. }
  935. ret = init_ieee1394_nodemgr();
  936. if (ret < 0) {
  937. HPSB_INFO("init nodemgr failed");
  938. goto cleanup_csr;
  939. }
  940. return 0;
  941. cleanup_csr:
  942. cleanup_csr();
  943. release_class_protocol:
  944. class_destroy(hpsb_protocol_class);
  945. release_class_host:
  946. class_unregister(&hpsb_host_class);
  947. release_all_bus:
  948. for (i = 0; fw_bus_attrs[i]; i++)
  949. bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
  950. bus_unregister(&ieee1394_bus_type);
  951. release_chrdev:
  952. unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
  953. exit_release_kernel_thread:
  954. kthread_stop(khpsbpkt_thread);
  955. exit_cleanup_config_roms:
  956. hpsb_cleanup_config_roms();
  957. return ret;
  958. }
  959. static void __exit ieee1394_cleanup(void)
  960. {
  961. int i;
  962. if (!disable_nodemgr)
  963. cleanup_ieee1394_nodemgr();
  964. cleanup_csr();
  965. class_destroy(hpsb_protocol_class);
  966. class_unregister(&hpsb_host_class);
  967. for (i = 0; fw_bus_attrs[i]; i++)
  968. bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
  969. bus_unregister(&ieee1394_bus_type);
  970. kthread_stop(khpsbpkt_thread);
  971. hpsb_cleanup_config_roms();
  972. unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
  973. }
  974. fs_initcall(ieee1394_init); /* same as ohci1394 */
  975. module_exit(ieee1394_cleanup);
  976. /* Exported symbols */
  977. /** hosts.c **/
  978. EXPORT_SYMBOL(hpsb_alloc_host);
  979. EXPORT_SYMBOL(hpsb_add_host);
  980. EXPORT_SYMBOL(hpsb_remove_host);
  981. EXPORT_SYMBOL(hpsb_update_config_rom_image);
  982. /** ieee1394_core.c **/
  983. EXPORT_SYMBOL(hpsb_speedto_str);
  984. EXPORT_SYMBOL(hpsb_protocol_class);
  985. EXPORT_SYMBOL(hpsb_set_packet_complete_task);
  986. EXPORT_SYMBOL(hpsb_alloc_packet);
  987. EXPORT_SYMBOL(hpsb_free_packet);
  988. EXPORT_SYMBOL(hpsb_send_packet);
  989. EXPORT_SYMBOL(hpsb_reset_bus);
  990. EXPORT_SYMBOL(hpsb_bus_reset);
  991. EXPORT_SYMBOL(hpsb_selfid_received);
  992. EXPORT_SYMBOL(hpsb_selfid_complete);
  993. EXPORT_SYMBOL(hpsb_packet_sent);
  994. EXPORT_SYMBOL(hpsb_packet_received);
  995. EXPORT_SYMBOL_GPL(hpsb_disable_irm);
  996. /** ieee1394_transactions.c **/
  997. EXPORT_SYMBOL(hpsb_get_tlabel);
  998. EXPORT_SYMBOL(hpsb_free_tlabel);
  999. EXPORT_SYMBOL(hpsb_make_readpacket);
  1000. EXPORT_SYMBOL(hpsb_make_writepacket);
  1001. EXPORT_SYMBOL(hpsb_make_streampacket);
  1002. EXPORT_SYMBOL(hpsb_make_lockpacket);
  1003. EXPORT_SYMBOL(hpsb_make_lock64packet);
  1004. EXPORT_SYMBOL(hpsb_make_phypacket);
  1005. EXPORT_SYMBOL(hpsb_make_isopacket);
  1006. EXPORT_SYMBOL(hpsb_read);
  1007. EXPORT_SYMBOL(hpsb_write);
  1008. EXPORT_SYMBOL(hpsb_packet_success);
  1009. /** highlevel.c **/
  1010. EXPORT_SYMBOL(hpsb_register_highlevel);
  1011. EXPORT_SYMBOL(hpsb_unregister_highlevel);
  1012. EXPORT_SYMBOL(hpsb_register_addrspace);
  1013. EXPORT_SYMBOL(hpsb_unregister_addrspace);
  1014. EXPORT_SYMBOL(hpsb_allocate_and_register_addrspace);
  1015. EXPORT_SYMBOL(hpsb_listen_channel);
  1016. EXPORT_SYMBOL(hpsb_unlisten_channel);
  1017. EXPORT_SYMBOL(hpsb_get_hostinfo);
  1018. EXPORT_SYMBOL(hpsb_create_hostinfo);
  1019. EXPORT_SYMBOL(hpsb_destroy_hostinfo);
  1020. EXPORT_SYMBOL(hpsb_set_hostinfo_key);
  1021. EXPORT_SYMBOL(hpsb_get_hostinfo_bykey);
  1022. EXPORT_SYMBOL(hpsb_set_hostinfo);
  1023. EXPORT_SYMBOL(highlevel_host_reset);
  1024. /** nodemgr.c **/
  1025. EXPORT_SYMBOL(hpsb_node_fill_packet);
  1026. EXPORT_SYMBOL(hpsb_node_write);
  1027. EXPORT_SYMBOL(__hpsb_register_protocol);
  1028. EXPORT_SYMBOL(hpsb_unregister_protocol);
  1029. /** csr.c **/
  1030. EXPORT_SYMBOL(hpsb_update_config_rom);
  1031. /** dma.c **/
  1032. EXPORT_SYMBOL(dma_prog_region_init);
  1033. EXPORT_SYMBOL(dma_prog_region_alloc);
  1034. EXPORT_SYMBOL(dma_prog_region_free);
  1035. EXPORT_SYMBOL(dma_region_init);
  1036. EXPORT_SYMBOL(dma_region_alloc);
  1037. EXPORT_SYMBOL(dma_region_free);
  1038. EXPORT_SYMBOL(dma_region_sync_for_cpu);
  1039. EXPORT_SYMBOL(dma_region_sync_for_device);
  1040. EXPORT_SYMBOL(dma_region_mmap);
  1041. EXPORT_SYMBOL(dma_region_offset_to_bus);
  1042. /** iso.c **/
  1043. EXPORT_SYMBOL(hpsb_iso_xmit_init);
  1044. EXPORT_SYMBOL(hpsb_iso_recv_init);
  1045. EXPORT_SYMBOL(hpsb_iso_xmit_start);
  1046. EXPORT_SYMBOL(hpsb_iso_recv_start);
  1047. EXPORT_SYMBOL(hpsb_iso_recv_listen_channel);
  1048. EXPORT_SYMBOL(hpsb_iso_recv_unlisten_channel);
  1049. EXPORT_SYMBOL(hpsb_iso_recv_set_channel_mask);
  1050. EXPORT_SYMBOL(hpsb_iso_stop);
  1051. EXPORT_SYMBOL(hpsb_iso_shutdown);
  1052. EXPORT_SYMBOL(hpsb_iso_xmit_queue_packet);
  1053. EXPORT_SYMBOL(hpsb_iso_xmit_sync);
  1054. EXPORT_SYMBOL(hpsb_iso_recv_release_packets);
  1055. EXPORT_SYMBOL(hpsb_iso_n_ready);
  1056. EXPORT_SYMBOL(hpsb_iso_packet_sent);
  1057. EXPORT_SYMBOL(hpsb_iso_packet_received);
  1058. EXPORT_SYMBOL(hpsb_iso_wake);
  1059. EXPORT_SYMBOL(hpsb_iso_recv_flush);
  1060. /** csr1212.c **/
  1061. EXPORT_SYMBOL(csr1212_new_directory);
  1062. EXPORT_SYMBOL(csr1212_attach_keyval_to_directory);
  1063. EXPORT_SYMBOL(csr1212_detach_keyval_from_directory);
  1064. EXPORT_SYMBOL(csr1212_release_keyval);
  1065. EXPORT_SYMBOL(csr1212_read);
  1066. EXPORT_SYMBOL(csr1212_parse_keyval);
  1067. EXPORT_SYMBOL(_csr1212_read_keyval);
  1068. EXPORT_SYMBOL(_csr1212_destroy_keyval);