Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
firewire-cdev.h
Go to the documentation of this file.
1 /*
2  * Char device interface.
3  *
4  * Copyright (C) 2005-2007 Kristian Hoegsberg <[email protected]>
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the next
14  * paragraph) shall be included in all copies or substantial portions of the
15  * Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23  * DEALINGS IN THE SOFTWARE.
24  */
25 
26 #ifndef _LINUX_FIREWIRE_CDEV_H
27 #define _LINUX_FIREWIRE_CDEV_H
28 
29 #include <linux/ioctl.h>
30 #include <linux/types.h>
32 
33 /* available since kernel version 2.6.22 */
34 #define FW_CDEV_EVENT_BUS_RESET 0x00
35 #define FW_CDEV_EVENT_RESPONSE 0x01
36 #define FW_CDEV_EVENT_REQUEST 0x02
37 #define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
38 
39 /* available since kernel version 2.6.30 */
40 #define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04
41 #define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05
42 
43 /* available since kernel version 2.6.36 */
44 #define FW_CDEV_EVENT_REQUEST2 0x06
45 #define FW_CDEV_EVENT_PHY_PACKET_SENT 0x07
46 #define FW_CDEV_EVENT_PHY_PACKET_RECEIVED 0x08
47 #define FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL 0x09
48 
64 };
65 
94 };
95 
122 };
123 
140 };
141 
203 };
204 
263 };
264 
300 };
301 
329 };
330 
353 };
354 
385  struct fw_cdev_event_request2 request2; /* added in 2.6.36 */
387  struct fw_cdev_event_iso_interrupt_mc iso_interrupt_mc; /* added in 2.6.36 */
388  struct fw_cdev_event_iso_resource iso_resource; /* added in 2.6.30 */
389  struct fw_cdev_event_phy_packet phy_packet; /* added in 2.6.36 */
390 };
391 
392 /* available since kernel version 2.6.22 */
393 #define FW_CDEV_IOC_GET_INFO _IOWR('#', 0x00, struct fw_cdev_get_info)
394 #define FW_CDEV_IOC_SEND_REQUEST _IOW('#', 0x01, struct fw_cdev_send_request)
395 #define FW_CDEV_IOC_ALLOCATE _IOWR('#', 0x02, struct fw_cdev_allocate)
396 #define FW_CDEV_IOC_DEALLOCATE _IOW('#', 0x03, struct fw_cdev_deallocate)
397 #define FW_CDEV_IOC_SEND_RESPONSE _IOW('#', 0x04, struct fw_cdev_send_response)
398 #define FW_CDEV_IOC_INITIATE_BUS_RESET _IOW('#', 0x05, struct fw_cdev_initiate_bus_reset)
399 #define FW_CDEV_IOC_ADD_DESCRIPTOR _IOWR('#', 0x06, struct fw_cdev_add_descriptor)
400 #define FW_CDEV_IOC_REMOVE_DESCRIPTOR _IOW('#', 0x07, struct fw_cdev_remove_descriptor)
401 #define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IOWR('#', 0x08, struct fw_cdev_create_iso_context)
402 #define FW_CDEV_IOC_QUEUE_ISO _IOWR('#', 0x09, struct fw_cdev_queue_iso)
403 #define FW_CDEV_IOC_START_ISO _IOW('#', 0x0a, struct fw_cdev_start_iso)
404 #define FW_CDEV_IOC_STOP_ISO _IOW('#', 0x0b, struct fw_cdev_stop_iso)
405 
406 /* available since kernel version 2.6.24 */
407 #define FW_CDEV_IOC_GET_CYCLE_TIMER _IOR('#', 0x0c, struct fw_cdev_get_cycle_timer)
408 
409 /* available since kernel version 2.6.30 */
410 #define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE _IOWR('#', 0x0d, struct fw_cdev_allocate_iso_resource)
411 #define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate)
412 #define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x0f, struct fw_cdev_allocate_iso_resource)
413 #define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x10, struct fw_cdev_allocate_iso_resource)
414 #define FW_CDEV_IOC_GET_SPEED _IO('#', 0x11) /* returns speed code */
415 #define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request)
416 #define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet)
417 
418 /* available since kernel version 2.6.34 */
419 #define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2)
420 
421 /* available since kernel version 2.6.36 */
422 #define FW_CDEV_IOC_SEND_PHY_PACKET _IOWR('#', 0x15, struct fw_cdev_send_phy_packet)
423 #define FW_CDEV_IOC_RECEIVE_PHY_PACKETS _IOW('#', 0x16, struct fw_cdev_receive_phy_packets)
424 #define FW_CDEV_IOC_SET_ISO_CHANNELS _IOW('#', 0x17, struct fw_cdev_set_iso_channels)
425 
426 /* available since kernel version 3.4 */
427 #define FW_CDEV_IOC_FLUSH_ISO _IOW('#', 0x18, struct fw_cdev_flush_iso)
428 
429 /*
430  * ABI version history
431  * 1 (2.6.22) - initial version
432  * (2.6.24) - added %FW_CDEV_IOC_GET_CYCLE_TIMER
433  * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if
434  * &fw_cdev_create_iso_context.header_size is 8 or more
435  * - added %FW_CDEV_IOC_*_ISO_RESOURCE*,
436  * %FW_CDEV_IOC_GET_SPEED, %FW_CDEV_IOC_SEND_BROADCAST_REQUEST,
437  * %FW_CDEV_IOC_SEND_STREAM_PACKET
438  * (2.6.32) - added time stamp to xmit &fw_cdev_event_iso_interrupt
439  * (2.6.33) - IR has always packet-per-buffer semantics now, not one of
440  * dual-buffer or packet-per-buffer depending on hardware
441  * - shared use and auto-response for FCP registers
442  * 3 (2.6.34) - made &fw_cdev_get_cycle_timer reliable
443  * - added %FW_CDEV_IOC_GET_CYCLE_TIMER2
444  * 4 (2.6.36) - added %FW_CDEV_EVENT_REQUEST2, %FW_CDEV_EVENT_PHY_PACKET_*,
445  * and &fw_cdev_allocate.region_end
446  * - implemented &fw_cdev_event_bus_reset.bm_node_id
447  * - added %FW_CDEV_IOC_SEND_PHY_PACKET, _RECEIVE_PHY_PACKETS
448  * - added %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL,
449  * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and
450  * %FW_CDEV_IOC_SET_ISO_CHANNELS
451  * 5 (3.4) - send %FW_CDEV_EVENT_ISO_INTERRUPT events when needed to
452  * avoid dropping data
453  * - added %FW_CDEV_IOC_FLUSH_ISO
454  */
455 
488 };
489 
512 };
513 
532 };
533 
576  __u64 region_end; /* available since kernel version 2.6.36 */
577 };
578 
586 };
587 
588 #define FW_CDEV_LONG_RESET 0
589 #define FW_CDEV_SHORT_RESET 1
590 
606 };
607 
643 };
644 
656 };
657 
658 #define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
659 #define FW_CDEV_ISO_CONTEXT_RECEIVE 1
660 #define FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL 2 /* added in 2.6.36 */
661 
703 };
704 
719 };
720 
721 #define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
722 #define FW_CDEV_ISO_INTERRUPT (1 << 16)
723 #define FW_CDEV_ISO_SKIP (1 << 17)
724 #define FW_CDEV_ISO_SYNC (1 << 17)
725 #define FW_CDEV_ISO_TAG(v) ((v) << 18)
726 #define FW_CDEV_ISO_SY(v) ((v) << 20)
727 #define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
728 
801 };
802 
829 };
830 
831 #define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
832 #define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2
833 #define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4
834 #define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8
835 #define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
836 
853 };
854 
861 };
862 
880 };
881 
896 };
897 
922 };
923 
973 };
974 
1000 };
1001 
1022 };
1023 
1035 };
1036 
1037 #define FW_CDEV_VERSION 3 /* Meaningless legacy macro; don't use it. */
1038 
1039 #endif /* _LINUX_FIREWIRE_CDEV_H */