aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-05-07 20:33:37 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-05-10 18:24:13 +0200
commit4c5a443e80e6d85e5c84a56bf30b61fe84c1f292 (patch)
treec5404475fe48376d9151c08c4cc37eb507fcd5e3
parent04dfb8dbd200c574b2f292146ef817d9745c8936 (diff)
firewire: Break out shared IEEE1394 constant to separate header file.
Signed-off-by: Kristian Hoegsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r--drivers/firewire/fw-transaction.h61
-rw-r--r--include/linux/firewire-cdev.h51
-rw-r--r--include/linux/firewire-constants.h67
3 files changed, 74 insertions, 105 deletions
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index a1507cf8d76..acdc3be38c6 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -25,18 +25,7 @@
#include <linux/list.h>
#include <linux/fs.h>
#include <linux/dma-mapping.h>
-
-#define TCODE_WRITE_QUADLET_REQUEST 0
-#define TCODE_WRITE_BLOCK_REQUEST 1
-#define TCODE_WRITE_RESPONSE 2
-#define TCODE_READ_QUADLET_REQUEST 4
-#define TCODE_READ_BLOCK_REQUEST 5
-#define TCODE_READ_QUADLET_RESPONSE 6
-#define TCODE_READ_BLOCK_RESPONSE 7
-#define TCODE_CYCLE_START 8
-#define TCODE_LOCK_REQUEST 9
-#define TCODE_STREAM_DATA 10
-#define TCODE_LOCK_RESPONSE 11
+#include <linux/firewire-constants.h>
#define TCODE_IS_READ_REQUEST(tcode) (((tcode) & ~1) == 4)
#define TCODE_IS_BLOCK_PACKET(tcode) (((tcode) & 1) != 0)
@@ -45,54 +34,6 @@
#define TCODE_HAS_REQUEST_DATA(tcode) (((tcode) & 12) != 4)
#define TCODE_HAS_RESPONSE_DATA(tcode) (((tcode) & 12) != 0)
-/* Juju specific tcodes */
-#define TCODE_DEALLOCATE 0x10
-#define TCODE_LOCK_MASK_SWAP 0x11
-#define TCODE_LOCK_COMPARE_SWAP 0x12
-#define TCODE_LOCK_FETCH_ADD 0x13
-#define TCODE_LOCK_LITTLE_ADD 0x14
-#define TCODE_LOCK_BOUNDED_ADD 0x15
-#define TCODE_LOCK_WRAP_ADD 0x16
-#define TCODE_LOCK_VENDOR_SPECIFIC 0x17
-
-#define SCODE_100 0x0
-#define SCODE_200 0x1
-#define SCODE_400 0x2
-#define SCODE_BETA 0x3
-
-#define EXTCODE_MASK_SWAP 0x1
-#define EXTCODE_COMPARE_SWAP 0x2
-#define EXTCODE_FETCH_ADD 0x3
-#define EXTCODE_LITTLE_ADD 0x4
-#define EXTCODE_BOUNDED_ADD 0x5
-#define EXTCODE_WRAP_ADD 0x6
-
-#define ACK_COMPLETE 0x1
-#define ACK_PENDING 0x2
-#define ACK_BUSY_X 0x4
-#define ACK_BUSY_A 0x5
-#define ACK_BUSY_B 0x6
-#define ACK_DATA_ERROR 0xd
-#define ACK_TYPE_ERROR 0xe
-
-#define RCODE_COMPLETE 0x0
-#define RCODE_CONFLICT_ERROR 0x4
-#define RCODE_DATA_ERROR 0x5
-#define RCODE_TYPE_ERROR 0x6
-#define RCODE_ADDRESS_ERROR 0x7
-
-/* Juju specific rcodes */
-#define RCODE_SEND_ERROR 0x10
-#define RCODE_CANCELLED 0x11
-#define RCODE_BUSY 0x12
-#define RCODE_GENERATION 0x13
-#define RCODE_NO_ACK 0x14
-
-#define RETRY_1 0x00
-#define RETRY_X 0x01
-#define RETRY_A 0x02
-#define RETRY_B 0x03
-
#define LOCAL_BUS 0xffc0
#define SELFID_PORT_CHILD 0x3
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 3cb83a1fa9b..d4455eb2ae3 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -1,6 +1,5 @@
-/* -*- c-basic-offset: 8 -*-
- *
- * fw-device-cdev.h -- Char device interface.
+/*
+ * Char device interface.
*
* Copyright (C) 2005-2006 Kristian Hoegsberg <krh@bitplanet.net>
*
@@ -19,50 +18,12 @@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#ifndef __fw_cdev_h
-#define __fw_cdev_h
+#ifndef _LINUX_FIREWIRE_CDEV_H
+#define _LINUX_FIREWIRE_CDEV_H
#include <linux/ioctl.h>
#include <linux/types.h>
-
-#define TCODE_WRITE_QUADLET_REQUEST 0
-#define TCODE_WRITE_BLOCK_REQUEST 1
-#define TCODE_WRITE_RESPONSE 2
-#define TCODE_READ_QUADLET_REQUEST 4
-#define TCODE_READ_BLOCK_REQUEST 5
-#define TCODE_READ_QUADLET_RESPONSE 6
-#define TCODE_READ_BLOCK_RESPONSE 7
-#define TCODE_CYCLE_START 8
-#define TCODE_LOCK_REQUEST 9
-#define TCODE_STREAM_DATA 10
-#define TCODE_LOCK_RESPONSE 11
-
-#define TCODE_LOCK_MASK_SWAP 0x11
-#define TCODE_LOCK_COMPARE_SWAP 0x12
-#define TCODE_LOCK_FETCH_ADD 0x13
-#define TCODE_LOCK_LITTLE_ADD 0x14
-#define TCODE_LOCK_BOUNDED_ADD 0x15
-#define TCODE_LOCK_WRAP_ADD 0x16
-#define TCODE_LOCK_VENDOR_DEPENDENT 0x17
-
-#define RCODE_COMPLETE 0x0
-#define RCODE_CONFLICT_ERROR 0x4
-#define RCODE_DATA_ERROR 0x5
-#define RCODE_TYPE_ERROR 0x6
-#define RCODE_ADDRESS_ERROR 0x7
-
-#define RCODE_SEND_ERROR 0x10
-#define RCODE_CANCELLED 0x11
-#define RCODE_BUSY 0x12
-#define RCODE_GENERATION 0x13
-#define RCODE_NO_ACK 0x14
-
-#define SCODE_100 0x0
-#define SCODE_200 0x1
-#define SCODE_400 0x2
-#define SCODE_800 0x3
-#define SCODE_1600 0x4
-#define SCODE_3200 0x5
+#include <linux/firewire-constants.h>
#define FW_CDEV_EVENT_BUS_RESET 0x00
#define FW_CDEV_EVENT_RESPONSE 0x01
@@ -265,4 +226,4 @@ struct fw_cdev_stop_iso {
__u32 handle;
};
-#endif /* __fw_cdev_h */
+#endif /* _LINUX_FIREWIRE_CDEV_H */
diff --git a/include/linux/firewire-constants.h b/include/linux/firewire-constants.h
new file mode 100644
index 00000000000..b316770a43f
--- /dev/null
+++ b/include/linux/firewire-constants.h
@@ -0,0 +1,67 @@
+#ifndef _LINUX_FIREWIRE_CONSTANTS_H
+#define _LINUX_FIREWIRE_CONSTANTS_H
+
+#define TCODE_WRITE_QUADLET_REQUEST 0x0
+#define TCODE_WRITE_BLOCK_REQUEST 0x1
+#define TCODE_WRITE_RESPONSE 0x2
+#define TCODE_READ_QUADLET_REQUEST 0x4
+#define TCODE_READ_BLOCK_REQUEST 0x5
+#define TCODE_READ_QUADLET_RESPONSE 0x6
+#define TCODE_READ_BLOCK_RESPONSE 0x7
+#define TCODE_CYCLE_START 0x8
+#define TCODE_LOCK_REQUEST 0x9
+#define TCODE_STREAM_DATA 0xa
+#define TCODE_LOCK_RESPONSE 0xb
+
+#define EXTCODE_MASK_SWAP 0x1
+#define EXTCODE_COMPARE_SWAP 0x2
+#define EXTCODE_FETCH_ADD 0x3
+#define EXTCODE_LITTLE_ADD 0x4
+#define EXTCODE_BOUNDED_ADD 0x5
+#define EXTCODE_WRAP_ADD 0x6
+#define EXTCODE_VENDOR_DEPENDENT 0x7
+
+/* Juju specific tcodes */
+#define TCODE_LOCK_MASK_SWAP (0x10 | EXTCODE_MASK_SWAP)
+#define TCODE_LOCK_COMPARE_SWAP (0x10 | EXTCODE_COMPARE_SWAP)
+#define TCODE_LOCK_FETCH_ADD (0x10 | EXTCODE_FETCH_ADD)
+#define TCODE_LOCK_LITTLE_ADD (0x10 | EXTCODE_LITTLE_ADD)
+#define TCODE_LOCK_BOUNDED_ADD (0x10 | EXTCODE_BOUNDED_ADD)
+#define TCODE_LOCK_WRAP_ADD (0x10 | EXTCODE_WRAP_ADD)
+#define TCODE_LOCK_VENDOR_DEPENDENT (0x10 | EXTCODE_VENDOR_DEPENDENT)
+
+#define RCODE_COMPLETE 0x0
+#define RCODE_CONFLICT_ERROR 0x4
+#define RCODE_DATA_ERROR 0x5
+#define RCODE_TYPE_ERROR 0x6
+#define RCODE_ADDRESS_ERROR 0x7
+
+/* Juju specific rcodes */
+#define RCODE_SEND_ERROR 0x10
+#define RCODE_CANCELLED 0x11
+#define RCODE_BUSY 0x12
+#define RCODE_GENERATION 0x13
+#define RCODE_NO_ACK 0x14
+
+#define SCODE_100 0x0
+#define SCODE_200 0x1
+#define SCODE_400 0x2
+#define SCODE_800 0x3
+#define SCODE_1600 0x4
+#define SCODE_3200 0x5
+#define SCODE_BETA 0x3
+
+#define ACK_COMPLETE 0x1
+#define ACK_PENDING 0x2
+#define ACK_BUSY_X 0x4
+#define ACK_BUSY_A 0x5
+#define ACK_BUSY_B 0x6
+#define ACK_DATA_ERROR 0xd
+#define ACK_TYPE_ERROR 0xe
+
+#define RETRY_1 0x00
+#define RETRY_X 0x01
+#define RETRY_A 0x02
+#define RETRY_B 0x03
+
+#endif /* _LINUX_FIREWIRE_CONSTANTS_H */