Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ieee1394: remove old isochronous ABI

Based on patch "the scheduled removal of RAW1394_REQ_ISO_{SEND,LISTEN}"
from Adrian Bunk, November 20 2006.

This patch also removes the underlying facilities in ohci1394 and
disables them in pcilynx. That is, hpsb_host_driver.devctl() and
hpsb_host_driver.transmit_packet() are no longer used for iso reception
and transmission.

Since video1394 and dv1394 only work with ohci1394 and raw1394's rawiso
interface has never been implemented in pcilynx, pcilynx is now no
longer useful for isochronous applications.

raw1394 will still handle the request types but will complete the
requests with errors that indicate API version conflicts.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

+48 -528
+16
Documentation/ABI/removed/raw1394_legacy_isochronous
··· 1 + What: legacy isochronous ABI of raw1394 (1st generation iso ABI) 2 + Date: June 2007 (scheduled), removed in kernel v2.6.23 3 + Contact: linux1394-devel@lists.sourceforge.net 4 + Description: 5 + The two request types RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN have 6 + been deprecated for quite some time. They are very inefficient as they 7 + come with high interrupt load and several layers of callbacks for each 8 + packet. Because of these deficiencies, the video1394 and dv1394 drivers 9 + and the 3rd-generation isochronous ABI in raw1394 (rawiso) were created. 10 + 11 + Users: 12 + libraw1394 users via the long deprecated API raw1394_iso_write, 13 + raw1394_start_iso_write, raw1394_start_iso_rcv, raw1394_stop_iso_rcv 14 + 15 + libdc1394, which optionally uses these old libraw1394 calls 16 + alternatively to the more efficient video1394 ABI
-10
Documentation/feature-removal-schedule.txt
··· 49 49 50 50 --------------------------- 51 51 52 - What: raw1394: requests of type RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN 53 - When: June 2007 54 - Why: Deprecated in favour of the more efficient and robust rawiso interface. 55 - Affected are applications which use the deprecated part of libraw1394 56 - (raw1394_iso_write, raw1394_start_iso_write, raw1394_start_iso_rcv, 57 - raw1394_stop_iso_rcv) or bypass libraw1394. 58 - Who: Dan Dennedy <dan@dennedy.org>, Stefan Richter <stefanr@s5r6.in-berlin.de> 59 - 60 - --------------------------- 61 - 62 52 What: old NCR53C9x driver 63 53 When: October 2007 64 54 Why: Replaced by the much better esp_scsi driver. Actual low-level
-45
drivers/ieee1394/highlevel.c
··· 483 483 return retval; 484 484 } 485 485 486 - /** 487 - * hpsb_listen_channel - enable receving a certain isochronous channel 488 - * 489 - * Reception is handled through the @hl's iso_receive op. 490 - */ 491 - int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 492 - unsigned int channel) 493 - { 494 - if (channel > 63) { 495 - HPSB_ERR("%s called with invalid channel", __FUNCTION__); 496 - return -EINVAL; 497 - } 498 - if (host->iso_listen_count[channel]++ == 0) 499 - return host->driver->devctl(host, ISO_LISTEN_CHANNEL, channel); 500 - return 0; 501 - } 502 - 503 - /** 504 - * hpsb_unlisten_channel - disable receving a certain isochronous channel 505 - */ 506 - void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 507 - unsigned int channel) 508 - { 509 - if (channel > 63) { 510 - HPSB_ERR("%s called with invalid channel", __FUNCTION__); 511 - return; 512 - } 513 - if (--host->iso_listen_count[channel] == 0) 514 - host->driver->devctl(host, ISO_UNLISTEN_CHANNEL, channel); 515 - } 516 - 517 486 static void init_hpsb_highlevel(struct hpsb_host *host) 518 487 { 519 488 INIT_LIST_HEAD(&dummy_zero_addr.host_list); ··· 535 566 list_for_each_entry(hl, &hl_irqs, irq_list) { 536 567 if (hl->host_reset) 537 568 hl->host_reset(host); 538 - } 539 - read_unlock_irqrestore(&hl_irqs_lock, flags); 540 - } 541 - 542 - void highlevel_iso_receive(struct hpsb_host *host, void *data, size_t length) 543 - { 544 - unsigned long flags; 545 - struct hpsb_highlevel *hl; 546 - int channel = (((quadlet_t *)data)[0] >> 8) & 0x3f; 547 - 548 - read_lock_irqsave(&hl_irqs_lock, flags); 549 - list_for_each_entry(hl, &hl_irqs, irq_list) { 550 - if (hl->iso_receive) 551 - hl->iso_receive(host, channel, data, length); 552 569 } 553 570 read_unlock_irqrestore(&hl_irqs_lock, flags); 554 571 }
+1 -15
drivers/ieee1394/highlevel.h
··· 26 26 struct hpsb_highlevel { 27 27 const char *name; 28 28 29 - /* Any of the following pointers can legally be NULL, except for 30 - * iso_receive which can only be NULL when you don't request 31 - * channels. */ 29 + /* Any of the following pointers can legally be NULL. */ 32 30 33 31 /* New host initialized. Will also be called during 34 32 * hpsb_register_highlevel for all hosts already installed. */ ··· 40 42 * Note that this one may occur during interrupt/bottom half handling. 41 43 * You can not expect to be able to do stock hpsb_reads. */ 42 44 void (*host_reset)(struct hpsb_host *host); 43 - 44 - /* An isochronous packet was received. Channel contains the channel 45 - * number for your convenience, it is also contained in the included 46 - * packet header (first quadlet, CRCs are missing). You may get called 47 - * for channel/host combinations you did not request. */ 48 - void (*iso_receive)(struct hpsb_host *host, int channel, 49 - quadlet_t *data, size_t length); 50 45 51 46 /* A write request was received on either the FCP_COMMAND (direction = 52 47 * 0) or the FCP_RESPONSE (direction = 1) register. The cts arg ··· 100 109 int highlevel_lock64(struct hpsb_host *host, int nodeid, octlet_t *store, 101 110 u64 addr, octlet_t data, octlet_t arg, int ext_tcode, 102 111 u16 flags); 103 - void highlevel_iso_receive(struct hpsb_host *host, void *data, size_t length); 104 112 void highlevel_fcp_request(struct hpsb_host *host, int nodeid, int direction, 105 113 void *data, size_t length); 106 114 ··· 115 125 struct hpsb_address_ops *ops, u64 start, u64 end); 116 126 int hpsb_unregister_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, 117 127 u64 start); 118 - int hpsb_listen_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 119 - unsigned int channel); 120 - void hpsb_unlisten_channel(struct hpsb_highlevel *hl, struct hpsb_host *host, 121 - unsigned int channel); 122 128 123 129 void *hpsb_get_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host); 124 130 void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host,
-8
drivers/ieee1394/hosts.h
··· 28 28 struct timer_list timeout; 29 29 unsigned long timeout_interval; 30 30 31 - unsigned char iso_listen_count[64]; 32 - 33 31 int node_count; /* number of identified nodes on this bus */ 34 32 int selfid_count; /* total number of SelfIDs received */ 35 33 int nodes_active; /* number of nodes with active link layer */ ··· 97 99 /* Cancel all outstanding async requests without resetting the bus. 98 100 * Return void. */ 99 101 CANCEL_REQUESTS, 100 - 101 - /* Start or stop receiving isochronous channel in arg. Return void. 102 - * This acts as an optimization hint, hosts are not required not to 103 - * listen on unrequested channels. */ 104 - ISO_LISTEN_CHANNEL, 105 - ISO_UNLISTEN_CHANNEL 106 102 }; 107 103 108 104 enum isoctl_cmd {
-8
drivers/ieee1394/ieee1394_core.c
··· 1028 1028 handle_incoming_packet(host, tcode, data, size, write_acked); 1029 1029 break; 1030 1030 1031 - 1032 - case TCODE_ISO_DATA: 1033 - highlevel_iso_receive(host, data, size); 1034 - break; 1035 - 1036 1031 case TCODE_CYCLE_START: 1037 1032 /* simply ignore this packet if it is passed on */ 1038 1033 break; ··· 1311 1316 EXPORT_SYMBOL(hpsb_make_lockpacket); 1312 1317 EXPORT_SYMBOL(hpsb_make_lock64packet); 1313 1318 EXPORT_SYMBOL(hpsb_make_phypacket); 1314 - EXPORT_SYMBOL(hpsb_make_isopacket); 1315 1319 EXPORT_SYMBOL(hpsb_read); 1316 1320 EXPORT_SYMBOL(hpsb_write); 1317 1321 EXPORT_SYMBOL(hpsb_packet_success); ··· 1321 1327 EXPORT_SYMBOL(hpsb_register_addrspace); 1322 1328 EXPORT_SYMBOL(hpsb_unregister_addrspace); 1323 1329 EXPORT_SYMBOL(hpsb_allocate_and_register_addrspace); 1324 - EXPORT_SYMBOL(hpsb_listen_channel); 1325 - EXPORT_SYMBOL(hpsb_unlisten_channel); 1326 1330 EXPORT_SYMBOL(hpsb_get_hostinfo); 1327 1331 EXPORT_SYMBOL(hpsb_create_hostinfo); 1328 1332 EXPORT_SYMBOL(hpsb_destroy_hostinfo);
+2 -3
drivers/ieee1394/ieee1394_core.h
··· 24 24 25 25 nodeid_t node_id; 26 26 27 - /* Async and Iso types should be clear, raw means send-as-is, do not 28 - * CRC! Byte swapping shall still be done in this case. */ 29 - enum { hpsb_async, hpsb_iso, hpsb_raw } __attribute__((packed)) type; 27 + /* hpsb_raw = send as-is, do not CRC (but still byte-swap it) */ 28 + enum { hpsb_async, hpsb_raw } __attribute__((packed)) type; 30 29 31 30 /* Okay, this is core internal and a no care for hosts. 32 31 * queued = queued for sending
-30
drivers/ieee1394/ieee1394_transactions.c
··· 89 89 packet->expect_response = 1; 90 90 } 91 91 92 - static void fill_iso_packet(struct hpsb_packet *packet, int length, int channel, 93 - int tag, int sync) 94 - { 95 - packet->header[0] = (length << 16) | (tag << 14) | (channel << 8) 96 - | (TCODE_ISO_DATA << 4) | sync; 97 - 98 - packet->header_size = 4; 99 - packet->data_size = length; 100 - packet->type = hpsb_iso; 101 - packet->tcode = TCODE_ISO_DATA; 102 - } 103 - 104 92 static void fill_phy_packet(struct hpsb_packet *packet, quadlet_t data) 105 93 { 106 94 packet->header[0] = data; ··· 475 487 476 488 p->host = host; 477 489 fill_phy_packet(p, data); 478 - 479 - return p; 480 - } 481 - 482 - struct hpsb_packet *hpsb_make_isopacket(struct hpsb_host *host, 483 - int length, int channel, 484 - int tag, int sync) 485 - { 486 - struct hpsb_packet *p; 487 - 488 - p = hpsb_alloc_packet(length); 489 - if (!p) 490 - return NULL; 491 - 492 - p->host = host; 493 - fill_iso_packet(p, length, channel, tag, sync); 494 - 495 - p->generation = get_hpsb_generation(host); 496 490 497 491 return p; 498 492 }
-2
drivers/ieee1394/ieee1394_transactions.h
··· 19 19 nodeid_t node, u64 addr, int extcode, 20 20 octlet_t *data, octlet_t arg); 21 21 struct hpsb_packet *hpsb_make_phypacket(struct hpsb_host *host, quadlet_t data); 22 - struct hpsb_packet *hpsb_make_isopacket(struct hpsb_host *host, int length, 23 - int channel, int tag, int sync); 24 22 struct hpsb_packet *hpsb_make_writepacket(struct hpsb_host *host, 25 23 nodeid_t node, u64 addr, 26 24 quadlet_t *buffer, size_t length);
+10 -211
drivers/ieee1394/ohci1394.c
··· 157 157 static int alloc_dma_rcv_ctx(struct ti_ohci *ohci, struct dma_rcv_ctx *d, 158 158 enum context_type type, int ctx, int num_desc, 159 159 int buf_size, int split_buf_size, int context_base); 160 - static void stop_dma_rcv_ctx(struct dma_rcv_ctx *d); 161 160 static void free_dma_rcv_ctx(struct dma_rcv_ctx *d); 162 161 163 162 static int alloc_dma_trm_ctx(struct ti_ohci *ohci, struct dma_trm_ctx *d, ··· 519 520 initialize_dma_trm_ctx(&ohci->at_req_context); 520 521 initialize_dma_trm_ctx(&ohci->at_resp_context); 521 522 522 - /* Initialize IR Legacy DMA channel mask */ 523 - ohci->ir_legacy_channels = 0; 524 - 525 523 /* Accept AR requests from all nodes */ 526 524 reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000); 527 525 ··· 865 869 return -EOVERFLOW; 866 870 } 867 871 868 - /* Decide whether we have an iso, a request, or a response packet */ 869 872 if (packet->type == hpsb_raw) 870 873 d = &ohci->at_req_context; 871 - else if ((packet->tcode == TCODE_ISO_DATA) && (packet->type == hpsb_iso)) { 872 - /* The legacy IT DMA context is initialized on first 873 - * use. However, the alloc cannot be run from 874 - * interrupt context, so we bail out if that is the 875 - * case. I don't see anyone sending ISO packets from 876 - * interrupt context anyway... */ 877 - 878 - if (ohci->it_legacy_context.ohci == NULL) { 879 - if (in_interrupt()) { 880 - PRINT(KERN_ERR, 881 - "legacy IT context cannot be initialized during interrupt"); 882 - return -EINVAL; 883 - } 884 - 885 - if (alloc_dma_trm_ctx(ohci, &ohci->it_legacy_context, 886 - DMA_CTX_ISO, 0, IT_NUM_DESC, 887 - OHCI1394_IsoXmitContextBase) < 0) { 888 - PRINT(KERN_ERR, 889 - "error initializing legacy IT context"); 890 - return -ENOMEM; 891 - } 892 - 893 - initialize_dma_trm_ctx(&ohci->it_legacy_context); 894 - } 895 - 896 - d = &ohci->it_legacy_context; 897 - } else if ((packet->tcode & 0x02) && (packet->tcode != TCODE_ISO_DATA)) 874 + else if ((packet->tcode & 0x02) && (packet->tcode != TCODE_ISO_DATA)) 898 875 d = &ohci->at_resp_context; 899 876 else 900 877 d = &ohci->at_req_context; ··· 886 917 static int ohci_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg) 887 918 { 888 919 struct ti_ohci *ohci = host->hostdata; 889 - int retval = 0; 890 - unsigned long flags; 891 - int phy_reg; 920 + int retval = 0, phy_reg; 892 921 893 922 switch (cmd) { 894 923 case RESET_BUS: ··· 979 1012 dma_trm_reset(&ohci->at_resp_context); 980 1013 break; 981 1014 982 - case ISO_LISTEN_CHANNEL: 983 - { 984 - u64 mask; 985 - struct dma_rcv_ctx *d = &ohci->ir_legacy_context; 986 - int ir_legacy_active; 987 - 988 - if (arg<0 || arg>63) { 989 - PRINT(KERN_ERR, 990 - "%s: IS0 listen channel %d is out of range", 991 - __FUNCTION__, arg); 992 - return -EFAULT; 993 - } 994 - 995 - mask = (u64)0x1<<arg; 996 - 997 - spin_lock_irqsave(&ohci->IR_channel_lock, flags); 998 - 999 - if (ohci->ISO_channel_usage & mask) { 1000 - PRINT(KERN_ERR, 1001 - "%s: IS0 listen channel %d is already used", 1002 - __FUNCTION__, arg); 1003 - spin_unlock_irqrestore(&ohci->IR_channel_lock, flags); 1004 - return -EFAULT; 1005 - } 1006 - 1007 - ir_legacy_active = ohci->ir_legacy_channels; 1008 - 1009 - ohci->ISO_channel_usage |= mask; 1010 - ohci->ir_legacy_channels |= mask; 1011 - 1012 - spin_unlock_irqrestore(&ohci->IR_channel_lock, flags); 1013 - 1014 - if (!ir_legacy_active) { 1015 - if (ohci1394_register_iso_tasklet(ohci, 1016 - &ohci->ir_legacy_tasklet) < 0) { 1017 - PRINT(KERN_ERR, "No IR DMA context available"); 1018 - return -EBUSY; 1019 - } 1020 - 1021 - /* the IR context can be assigned to any DMA context 1022 - * by ohci1394_register_iso_tasklet */ 1023 - d->ctx = ohci->ir_legacy_tasklet.context; 1024 - d->ctrlSet = OHCI1394_IsoRcvContextControlSet + 1025 - 32*d->ctx; 1026 - d->ctrlClear = OHCI1394_IsoRcvContextControlClear + 1027 - 32*d->ctx; 1028 - d->cmdPtr = OHCI1394_IsoRcvCommandPtr + 32*d->ctx; 1029 - d->ctxtMatch = OHCI1394_IsoRcvContextMatch + 32*d->ctx; 1030 - 1031 - initialize_dma_rcv_ctx(&ohci->ir_legacy_context, 1); 1032 - 1033 - if (printk_ratelimit()) 1034 - DBGMSG("IR legacy activated"); 1035 - } 1036 - 1037 - spin_lock_irqsave(&ohci->IR_channel_lock, flags); 1038 - 1039 - if (arg>31) 1040 - reg_write(ohci, OHCI1394_IRMultiChanMaskHiSet, 1041 - 1<<(arg-32)); 1042 - else 1043 - reg_write(ohci, OHCI1394_IRMultiChanMaskLoSet, 1044 - 1<<arg); 1045 - 1046 - spin_unlock_irqrestore(&ohci->IR_channel_lock, flags); 1047 - DBGMSG("Listening enabled on channel %d", arg); 1048 - break; 1049 - } 1050 - case ISO_UNLISTEN_CHANNEL: 1051 - { 1052 - u64 mask; 1053 - 1054 - if (arg<0 || arg>63) { 1055 - PRINT(KERN_ERR, 1056 - "%s: IS0 unlisten channel %d is out of range", 1057 - __FUNCTION__, arg); 1058 - return -EFAULT; 1059 - } 1060 - 1061 - mask = (u64)0x1<<arg; 1062 - 1063 - spin_lock_irqsave(&ohci->IR_channel_lock, flags); 1064 - 1065 - if (!(ohci->ISO_channel_usage & mask)) { 1066 - PRINT(KERN_ERR, 1067 - "%s: IS0 unlisten channel %d is not used", 1068 - __FUNCTION__, arg); 1069 - spin_unlock_irqrestore(&ohci->IR_channel_lock, flags); 1070 - return -EFAULT; 1071 - } 1072 - 1073 - ohci->ISO_channel_usage &= ~mask; 1074 - ohci->ir_legacy_channels &= ~mask; 1075 - 1076 - if (arg>31) 1077 - reg_write(ohci, OHCI1394_IRMultiChanMaskHiClear, 1078 - 1<<(arg-32)); 1079 - else 1080 - reg_write(ohci, OHCI1394_IRMultiChanMaskLoClear, 1081 - 1<<arg); 1082 - 1083 - spin_unlock_irqrestore(&ohci->IR_channel_lock, flags); 1084 - DBGMSG("Listening disabled on channel %d", arg); 1085 - 1086 - if (ohci->ir_legacy_channels == 0) { 1087 - stop_dma_rcv_ctx(&ohci->ir_legacy_context); 1088 - DBGMSG("ISO legacy receive context stopped"); 1089 - } 1090 - 1091 - break; 1092 - } 1093 1015 default: 1094 1016 PRINT_G(KERN_ERR, "ohci_devctl cmd %d not implemented yet", 1095 1017 cmd); ··· 2724 2868 spin_unlock_irqrestore(&d->lock, flags); 2725 2869 } 2726 2870 2727 - static void stop_dma_rcv_ctx(struct dma_rcv_ctx *d) 2728 - { 2729 - if (d->ctrlClear) { 2730 - ohci1394_stop_context(d->ohci, d->ctrlClear, NULL); 2731 - 2732 - if (d->type == DMA_CTX_ISO) { 2733 - /* disable interrupts */ 2734 - reg_write(d->ohci, OHCI1394_IsoRecvIntMaskClear, 1 << d->ctx); 2735 - ohci1394_unregister_iso_tasklet(d->ohci, &d->ohci->ir_legacy_tasklet); 2736 - } else { 2737 - tasklet_kill(&d->task); 2738 - } 2739 - } 2740 - } 2741 - 2742 - 2743 2871 static void free_dma_rcv_ctx(struct dma_rcv_ctx *d) 2744 2872 { 2745 2873 int i; ··· 2845 3005 2846 3006 spin_lock_init(&d->lock); 2847 3007 2848 - if (type == DMA_CTX_ISO) { 2849 - ohci1394_init_iso_tasklet(&ohci->ir_legacy_tasklet, 2850 - OHCI_ISO_MULTICHANNEL_RECEIVE, 2851 - dma_rcv_tasklet, (unsigned long) d); 2852 - } else { 2853 - d->ctrlSet = context_base + OHCI1394_ContextControlSet; 2854 - d->ctrlClear = context_base + OHCI1394_ContextControlClear; 2855 - d->cmdPtr = context_base + OHCI1394_ContextCommandPtr; 3008 + d->ctrlSet = context_base + OHCI1394_ContextControlSet; 3009 + d->ctrlClear = context_base + OHCI1394_ContextControlClear; 3010 + d->cmdPtr = context_base + OHCI1394_ContextCommandPtr; 2856 3011 2857 - tasklet_init (&d->task, dma_rcv_tasklet, (unsigned long) d); 2858 - } 2859 - 3012 + tasklet_init(&d->task, dma_rcv_tasklet, (unsigned long) d); 2860 3013 return 0; 2861 3014 } 2862 3015 ··· 2930 3097 spin_lock_init(&d->lock); 2931 3098 2932 3099 /* initialize tasklet */ 2933 - if (type == DMA_CTX_ISO) { 2934 - ohci1394_init_iso_tasklet(&ohci->it_legacy_tasklet, OHCI_ISO_TRANSMIT, 2935 - dma_trm_tasklet, (unsigned long) d); 2936 - if (ohci1394_register_iso_tasklet(ohci, 2937 - &ohci->it_legacy_tasklet) < 0) { 2938 - PRINT(KERN_ERR, "No IT DMA context available"); 2939 - free_dma_trm_ctx(d); 2940 - return -EBUSY; 2941 - } 2942 - 2943 - /* IT can be assigned to any context by register_iso_tasklet */ 2944 - d->ctx = ohci->it_legacy_tasklet.context; 2945 - d->ctrlSet = OHCI1394_IsoXmitContextControlSet + 16 * d->ctx; 2946 - d->ctrlClear = OHCI1394_IsoXmitContextControlClear + 16 * d->ctx; 2947 - d->cmdPtr = OHCI1394_IsoXmitCommandPtr + 16 * d->ctx; 2948 - } else { 2949 - d->ctrlSet = context_base + OHCI1394_ContextControlSet; 2950 - d->ctrlClear = context_base + OHCI1394_ContextControlClear; 2951 - d->cmdPtr = context_base + OHCI1394_ContextCommandPtr; 2952 - tasklet_init (&d->task, dma_trm_tasklet, (unsigned long)d); 2953 - } 2954 - 3100 + d->ctrlSet = context_base + OHCI1394_ContextControlSet; 3101 + d->ctrlClear = context_base + OHCI1394_ContextControlClear; 3102 + d->cmdPtr = context_base + OHCI1394_ContextCommandPtr; 3103 + tasklet_init(&d->task, dma_trm_tasklet, (unsigned long)d); 2955 3104 return 0; 2956 3105 } 2957 3106 ··· 3159 3344 ohci->ISO_channel_usage = 0; 3160 3345 spin_lock_init(&ohci->IR_channel_lock); 3161 3346 3162 - /* Allocate the IR DMA context right here so we don't have 3163 - * to do it in interrupt path - note that this doesn't 3164 - * waste much memory and avoids the jugglery required to 3165 - * allocate it in IRQ path. */ 3166 - if (alloc_dma_rcv_ctx(ohci, &ohci->ir_legacy_context, 3167 - DMA_CTX_ISO, 0, IR_NUM_DESC, 3168 - IR_BUF_SIZE, IR_SPLIT_BUF_SIZE, 3169 - OHCI1394_IsoRcvContextBase) < 0) { 3170 - FAIL(-ENOMEM, "Cannot allocate IR Legacy DMA context"); 3171 - } 3172 - 3173 - /* We hopefully don't have to pre-allocate IT DMA like we did 3174 - * for IR DMA above. Allocate it on-demand and mark inactive. */ 3175 - ohci->it_legacy_context.ohci = NULL; 3176 3347 spin_lock_init(&ohci->event_lock); 3177 3348 3178 3349 /* ··· 3251 3450 free_dma_rcv_ctx(&ohci->ar_resp_context); 3252 3451 free_dma_trm_ctx(&ohci->at_req_context); 3253 3452 free_dma_trm_ctx(&ohci->at_resp_context); 3254 - free_dma_rcv_ctx(&ohci->ir_legacy_context); 3255 - free_dma_trm_ctx(&ohci->it_legacy_context); 3256 3453 3257 3454 case OHCI_INIT_HAVE_SELFID_BUFFER: 3258 3455 pci_free_consistent(ohci->dev, OHCI1394_SI_DMA_BUF_SIZE,
-14
drivers/ieee1394/ohci1394.h
··· 190 190 unsigned long ir_multichannel_used; /* ditto */ 191 191 spinlock_t IR_channel_lock; 192 192 193 - /* iso receive (legacy API) */ 194 - u64 ir_legacy_channels; /* note: this differs from ISO_channel_usage; 195 - it only accounts for channels listened to 196 - by the legacy API, so that we can know when 197 - it is safe to free the legacy API context */ 198 - 199 - struct dma_rcv_ctx ir_legacy_context; 200 - struct ohci1394_iso_tasklet ir_legacy_tasklet; 201 - 202 193 /* iso transmit */ 203 194 int nb_iso_xmit_ctx; 204 195 unsigned long it_ctx_usage; /* use test_and_set_bit() for atomicity */ 205 - 206 - /* iso transmit (legacy API) */ 207 - struct dma_trm_ctx it_legacy_context; 208 - struct ohci1394_iso_tasklet it_legacy_tasklet; 209 196 210 197 u64 ISO_channel_usage; 211 198 ··· 208 221 209 222 /* Tasklets for iso receive and transmit, used by video1394 210 223 * and dv1394 */ 211 - 212 224 struct list_head iso_tasklet_list; 213 225 spinlock_t iso_tasklet_list_lock; 214 226
+12 -4
drivers/ieee1394/pcilynx.c
··· 477 477 struct lynx_send_data *d; 478 478 struct hpsb_packet *packet; 479 479 480 + #if 0 /* has been removed from ieee1394 core */ 480 481 d = (what == hpsb_iso ? &lynx->iso_send : &lynx->async); 482 + #else 483 + d = &lynx->async; 484 + #endif 481 485 if (!list_empty(&d->pcl_queue)) { 482 486 PRINT(KERN_ERR, lynx->id, "trying to queue a new packet in nonempty fifo"); 483 487 BUG(); ··· 515 511 case hpsb_async: 516 512 pcl.buffer[0].control |= PCL_CMD_XMT; 517 513 break; 514 + #if 0 /* has been removed from ieee1394 core */ 518 515 case hpsb_iso: 519 516 pcl.buffer[0].control |= PCL_CMD_XMT | PCL_ISOMODE; 520 517 break; 518 + #endif 521 519 case hpsb_raw: 522 520 pcl.buffer[0].control |= PCL_CMD_UNFXMT; 523 521 break; ··· 548 542 case hpsb_raw: 549 543 d = &lynx->async; 550 544 break; 545 + #if 0 /* has been removed from ieee1394 core */ 551 546 case hpsb_iso: 552 547 d = &lynx->iso_send; 553 548 break; 549 + #endif 554 550 default: 555 551 PRINT(KERN_ERR, lynx->id, "invalid packet type %d", 556 552 packet->type); ··· 805 797 } 806 798 807 799 break; 808 - 800 + #if 0 /* has been removed from ieee1394 core */ 809 801 case ISO_LISTEN_CHANNEL: 810 802 spin_lock_irqsave(&lynx->iso_rcv.lock, flags); 811 803 ··· 827 819 828 820 spin_unlock_irqrestore(&lynx->iso_rcv.lock, flags); 829 821 break; 830 - 822 + #endif 831 823 default: 832 824 PRINT(KERN_ERR, lynx->id, "unknown devctl command %d", cmd); 833 825 retval = -1; ··· 1017 1009 pci_unmap_single(lynx->dev, lynx->iso_send.data_dma, 1018 1010 packet->data_size, PCI_DMA_TODEVICE); 1019 1011 } 1020 - 1012 + #if 0 /* has been removed from ieee1394 core */ 1021 1013 if (!list_empty(&lynx->iso_send.queue)) { 1022 1014 send_next(lynx, hpsb_iso); 1023 1015 } 1024 - 1016 + #endif 1025 1017 spin_unlock(&lynx->iso_send.queue_lock); 1026 1018 1027 1019 if (pcl.pcl_status & DMA_CHAN_STAT_PKTCMPL) {
-5
drivers/ieee1394/raw1394-private.h
··· 36 36 37 37 u8 __user *fcp_buffer; 38 38 39 - /* old ISO API */ 40 - u64 listen_channels; 41 - quadlet_t __user *iso_buffer; 42 - size_t iso_buffer_length; 43 - 44 39 u8 notification; /* (busreset-notification) RAW1394_NOTIFY_OFF/ON */ 45 40 46 41 /* new rawiso API */
+5 -171
drivers/ieee1394/raw1394.c
··· 98 98 99 99 static void queue_complete_cb(struct pending_request *req); 100 100 101 - #include <asm/current.h> 102 - static void print_old_iso_deprecation(void) 103 - { 104 - static pid_t p; 105 - 106 - if (p == current->pid) 107 - return; 108 - p = current->pid; 109 - printk(KERN_WARNING "raw1394: WARNING - Program \"%s\" uses unsupported" 110 - " isochronous request types which will be removed in a next" 111 - " kernel release\n", current->comm); 112 - printk(KERN_WARNING "raw1394: Update your software to use libraw1394's" 113 - " newer interface\n"); 114 - } 115 - 116 101 static struct pending_request *__alloc_pending_request(gfp_t flags) 117 102 { 118 103 struct pending_request *req; ··· 280 295 } 281 296 } 282 297 spin_unlock_irqrestore(&host_info_lock, flags); 283 - } 284 - 285 - static void iso_receive(struct hpsb_host *host, int channel, quadlet_t * data, 286 - size_t length) 287 - { 288 - unsigned long flags; 289 - struct host_info *hi; 290 - struct file_info *fi; 291 - struct pending_request *req, *req_next; 292 - struct iso_block_store *ibs = NULL; 293 - LIST_HEAD(reqs); 294 - 295 - if ((atomic_read(&iso_buffer_size) + length) > iso_buffer_max) { 296 - HPSB_INFO("dropped iso packet"); 297 - return; 298 - } 299 - 300 - spin_lock_irqsave(&host_info_lock, flags); 301 - hi = find_host_info(host); 302 - 303 - if (hi != NULL) { 304 - list_for_each_entry(fi, &hi->file_info_list, list) { 305 - if (!(fi->listen_channels & (1ULL << channel))) 306 - continue; 307 - 308 - req = __alloc_pending_request(GFP_ATOMIC); 309 - if (!req) 310 - break; 311 - 312 - if (!ibs) { 313 - ibs = kmalloc(sizeof(*ibs) + length, 314 - GFP_ATOMIC); 315 - if (!ibs) { 316 - kfree(req); 317 - break; 318 - } 319 - 320 - atomic_add(length, &iso_buffer_size); 321 - atomic_set(&ibs->refcount, 0); 322 - ibs->data_size = length; 323 - memcpy(ibs->data, data, length); 324 - } 325 - 326 - atomic_inc(&ibs->refcount); 327 - 328 - req->file_info = fi; 329 - req->ibs = ibs; 330 - req->data = ibs->data; 331 - req->req.type = RAW1394_REQ_ISO_RECEIVE; 332 - req->req.generation = get_hpsb_generation(host); 333 - req->req.misc = 0; 334 - req->req.recvb = ptr2int(fi->iso_buffer); 335 - req->req.length = min(length, fi->iso_buffer_length); 336 - 337 - list_add_tail(&req->list, &reqs); 338 - } 339 - } 340 - spin_unlock_irqrestore(&host_info_lock, flags); 341 - 342 - list_for_each_entry_safe(req, req_next, &reqs, list) 343 - queue_complete_req(req); 344 298 } 345 299 346 300 static void fcp_request(struct hpsb_host *host, int nodeid, int direction, ··· 604 680 return 0; 605 681 } 606 682 607 - static void handle_iso_listen(struct file_info *fi, struct pending_request *req) 608 - { 609 - int channel = req->req.misc; 610 - 611 - if ((channel > 63) || (channel < -64)) { 612 - req->req.error = RAW1394_ERROR_INVALID_ARG; 613 - } else if (channel >= 0) { 614 - /* allocate channel req.misc */ 615 - if (fi->listen_channels & (1ULL << channel)) { 616 - req->req.error = RAW1394_ERROR_ALREADY; 617 - } else { 618 - if (hpsb_listen_channel 619 - (&raw1394_highlevel, fi->host, channel)) { 620 - req->req.error = RAW1394_ERROR_ALREADY; 621 - } else { 622 - fi->listen_channels |= 1ULL << channel; 623 - fi->iso_buffer = int2ptr(req->req.recvb); 624 - fi->iso_buffer_length = req->req.length; 625 - } 626 - } 627 - } else { 628 - /* deallocate channel (one's complement neg) req.misc */ 629 - channel = ~channel; 630 - 631 - if (fi->listen_channels & (1ULL << channel)) { 632 - hpsb_unlisten_channel(&raw1394_highlevel, fi->host, 633 - channel); 634 - fi->listen_channels &= ~(1ULL << channel); 635 - } else { 636 - req->req.error = RAW1394_ERROR_INVALID_ARG; 637 - } 638 - } 639 - 640 - req->req.length = 0; 641 - queue_complete_req(req); 642 - } 643 - 644 683 static void handle_fcp_listen(struct file_info *fi, struct pending_request *req) 645 684 { 646 685 if (req->req.misc) { ··· 774 887 hpsb_free_tlabel(packet); 775 888 queue_complete_req(req); 776 889 } 777 - return 0; 778 - } 779 - 780 - static int handle_iso_send(struct file_info *fi, struct pending_request *req, 781 - int channel) 782 - { 783 - unsigned long flags; 784 - struct hpsb_packet *packet; 785 - 786 - packet = hpsb_make_isopacket(fi->host, req->req.length, channel & 0x3f, 787 - (req->req.misc >> 16) & 0x3, 788 - req->req.misc & 0xf); 789 - if (!packet) 790 - return -ENOMEM; 791 - 792 - packet->speed_code = req->req.address & 0x3; 793 - 794 - req->packet = packet; 795 - 796 - if (copy_from_user(packet->data, int2ptr(req->req.sendb), 797 - req->req.length)) { 798 - req->req.error = RAW1394_ERROR_MEMFAULT; 799 - req->req.length = 0; 800 - queue_complete_req(req); 801 - return 0; 802 - } 803 - 804 - req->req.length = 0; 805 - hpsb_set_packet_complete_task(packet, 806 - (void (*)(void *))queue_complete_req, 807 - req); 808 - 809 - spin_lock_irqsave(&fi->reqlists_lock, flags); 810 - list_add_tail(&req->list, &fi->req_pending); 811 - spin_unlock_irqrestore(&fi->reqlists_lock, flags); 812 - 813 - /* Update the generation of the packet just before sending. */ 814 - packet->generation = req->req.generation; 815 - 816 - if (hpsb_send_packet(packet) < 0) { 817 - req->req.error = RAW1394_ERROR_SEND_ERROR; 818 - queue_complete_req(req); 819 - } 820 - 821 890 return 0; 822 891 } 823 892 ··· 2160 2317 queue_complete_req(req); 2161 2318 return 0; 2162 2319 2163 - case RAW1394_REQ_ISO_SEND: 2164 - print_old_iso_deprecation(); 2165 - return handle_iso_send(fi, req, node); 2166 - 2167 2320 case RAW1394_REQ_ARM_REGISTER: 2168 2321 return arm_register(fi, req); 2169 2322 ··· 2175 2336 case RAW1394_REQ_RESET_NOTIFY: 2176 2337 return reset_notification(fi, req); 2177 2338 2339 + case RAW1394_REQ_ISO_SEND: 2178 2340 case RAW1394_REQ_ISO_LISTEN: 2179 - print_old_iso_deprecation(); 2180 - handle_iso_listen(fi, req); 2341 + printk(KERN_DEBUG "raw1394: old iso ABI has been removed\n"); 2342 + req->req.error = RAW1394_ERROR_COMPAT; 2343 + req->req.misc = RAW1394_KERNELAPI_VERSION; 2344 + queue_complete_req(req); 2181 2345 return 0; 2182 2346 2183 2347 case RAW1394_REQ_FCP_LISTEN: ··· 2807 2965 if (fi->iso_state != RAW1394_ISO_INACTIVE) 2808 2966 raw1394_iso_shutdown(fi); 2809 2967 2810 - for (i = 0; i < 64; i++) { 2811 - if (fi->listen_channels & (1ULL << i)) { 2812 - hpsb_unlisten_channel(&raw1394_highlevel, fi->host, i); 2813 - } 2814 - } 2815 - 2816 2968 spin_lock_irqsave(&host_info_lock, flags); 2817 - fi->listen_channels = 0; 2818 2969 2819 2970 fail = 0; 2820 2971 /* set address-entries invalid */ ··· 2969 3134 .add_host = add_host, 2970 3135 .remove_host = remove_host, 2971 3136 .host_reset = host_reset, 2972 - .iso_receive = iso_receive, 2973 3137 .fcp_request = fcp_request, 2974 3138 }; 2975 3139
+2 -2
drivers/ieee1394/raw1394.h
··· 17 17 #define RAW1394_REQ_ASYNC_WRITE 101 18 18 #define RAW1394_REQ_LOCK 102 19 19 #define RAW1394_REQ_LOCK64 103 20 - #define RAW1394_REQ_ISO_SEND 104 20 + #define RAW1394_REQ_ISO_SEND 104 /* removed ABI, now a no-op */ 21 21 #define RAW1394_REQ_ASYNC_SEND 105 22 22 #define RAW1394_REQ_ASYNC_STREAM 106 23 23 24 - #define RAW1394_REQ_ISO_LISTEN 200 24 + #define RAW1394_REQ_ISO_LISTEN 200 /* removed ABI, now a no-op */ 25 25 #define RAW1394_REQ_FCP_LISTEN 201 26 26 #define RAW1394_REQ_RESET_BUS 202 27 27 #define RAW1394_REQ_GET_ROM 203