Patch by JiSheng Zhang: Update the FireWire stack and tools to the current

FreeBSD version (r188928). Note to JiSheng: I did have to fix fwcontrol.c line
111, looked like a last minute change to me.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29752 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-03-28 10:01:21 +00:00
parent 4720c31bb0
commit 1719f7a63e
10 changed files with 806 additions and 341 deletions
+64 -21
View File
@@ -103,9 +103,16 @@ struct fw_reg_req_t {
#define FWRCODE_ER_TYPE 6
#define FWRCODE_ER_ADDR 7
/*
* Defined 1394a-2000
* Table 5B-1
*/
#define FWSPD_S100 0
#define FWSPD_S200 1
#define FWSPD_S400 2
#define FWSPD_S800 3
#define FWSPD_S1600 4
#define FWSPD_S3200 5
#define FWP_TL_VALID (1 << 7)
@@ -281,10 +288,18 @@ struct fw_devlstreq {
struct fw_devinfo dev[FW_MAX_DEVLST];
};
/*
* Defined in IEEE 1394a-2000
* 4.3.4.1
*/
#define FW_SELF_ID_PORT_CONNECTED_TO_CHILD 3
#define FW_SELF_ID_PORT_CONNECTED_TO_PARENT 2
#define FW_SELF_ID_PORT_NOT_CONNECTED 1
#define FW_SELF_ID_PORT_NOT_EXISTS 0
#define FW_SELF_ID_PAGE0 0
#define FW_SELF_ID_PAGE1 1
#if BYTE_ORDER == BIG_ENDIAN
union fw_self_id {
struct {
@@ -294,7 +309,7 @@ union fw_self_id {
link_active:1,
gap_count:6,
phy_speed:2,
phy_delay:2,
reserved:2,
contender:1,
power_class:3,
port0:2,
@@ -309,18 +324,32 @@ union fw_self_id {
phy_id:6,
sequel:1,
sequence_num:3,
:2,
porta:2,
portb:2,
portc:2,
portd:2,
porte:2,
portf:2,
portg:2,
porth:2,
:1,
reserved2:2,
port3:2,
port4:2,
port5:2,
port6:2,
port7:2,
port8:2,
port9:2,
port10:2,
reserved1:1,
more_packets:1;
} p1;
struct {
uint32_t
id:2,
phy_id:6,
sequel:1,
sequence_num:3,
:2,
port11:2,
port12:2,
port13:2,
port14:2,
port15:2,
:8;
} p2;
};
#else
union fw_self_id {
@@ -332,7 +361,7 @@ union fw_self_id {
port0:2,
power_class:3,
contender:1,
phy_delay:2,
reserved:2,
phy_speed:2,
gap_count:6,
link_active:1,
@@ -343,20 +372,34 @@ union fw_self_id {
struct {
uint32_t more_packets:1,
reserved1:1,
porth:2,
portg:2,
portf:2,
porte:2,
portd:2,
portc:2,
portb:2,
porta:2,
port10:2,
port9:2,
port8:2,
port7:2,
port6:2,
port5:2,
port4:2,
port3:2,
reserved2:2,
sequence_num:3,
sequel:1,
phy_id:6,
id:2;
} p1;
struct {
uint32_t
reserved3:8,
port15:2,
port14:2,
port13:2,
port12:2,
port11:2,
reserved4:2,
sequence_num:3,
sequel:1,
phy_id:6,
id:2;
} p2;
};
#endif
@@ -422,7 +465,7 @@ struct fw_crom_buf {
#endif
#define MAKEMINOR(f, u, s) \
unit2minor((f) | (((u) & 0xff) << 8) | (s & 0xff))
((f) | (((u) & 0xff) << 8) | (s & 0xff))
#define DEV2UNIT(x) ((dev2unit(x) & 0xff00) >> 8)
#define DEV2SUB(x) (dev2unit(x) & 0xff)
+12
View File
@@ -34,6 +34,10 @@
* $FreeBSD: src/sys/dev/firewire/fwphyreg.h,v 1.3 2005/01/06 01:42:41 imp Exp $
*/
/*
* IEEE 1394a
* Figure 5B - 1
*/
struct phyreg_base {
#if BYTE_ORDER == BIG_ENDIAN
uint8_t phy_id:6,
@@ -100,6 +104,10 @@ struct phyreg_base {
#endif
};
/*
* IEEE 1394a
* Figure 5B - 2
*/
struct phyreg_page0 {
#if BYTE_ORDER == BIG_ENDIAN
uint8_t astat:2,
@@ -160,6 +168,10 @@ struct phyreg_page0 {
#endif
};
/*
* IEEE 1394a
* Figure 5B - 3
*/
struct phyreg_page1 {
uint8_t compliance;
uint8_t :8;