aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2005-12-01 18:51:56 -0500
committerJody McIntyre <scjody@modernduck.com>2005-12-01 18:51:56 -0500
commitd7758461b9a8253f1c125e5907579e0594d29e3b (patch)
tree3273cf3f8a33dd962326d08cb6030e9c6d881f0b /drivers
parent14c0fa243b358c24040ff5f44b60c47aaf6430c3 (diff)
ieee1394: add definitions for phy packet constants
Introduce new macros related to phy packets and use them in ieee1394_core and nodemgr. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jody McIntyre <scjody@modernduck.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ieee1394/ieee1394.h19
-rw-r--r--drivers/ieee1394/ieee1394_core.c38
-rw-r--r--drivers/ieee1394/nodemgr.c3
3 files changed, 42 insertions, 18 deletions
diff --git a/drivers/ieee1394/ieee1394.h b/drivers/ieee1394/ieee1394.h
index b634a9bb365c..936d776de00a 100644
--- a/drivers/ieee1394/ieee1394.h
+++ b/drivers/ieee1394/ieee1394.h
@@ -62,6 +62,7 @@
62extern const char *hpsb_speedto_str[]; 62extern const char *hpsb_speedto_str[];
63 63
64 64
65/* 1394a cable PHY packets */
65#define SELFID_PWRCL_NO_POWER 0x0 66#define SELFID_PWRCL_NO_POWER 0x0
66#define SELFID_PWRCL_PROVIDE_15W 0x1 67#define SELFID_PWRCL_PROVIDE_15W 0x1
67#define SELFID_PWRCL_PROVIDE_30W 0x2 68#define SELFID_PWRCL_PROVIDE_30W 0x2
@@ -76,8 +77,24 @@ extern const char *hpsb_speedto_str[];
76#define SELFID_PORT_NCONN 0x1 77#define SELFID_PORT_NCONN 0x1
77#define SELFID_PORT_NONE 0x0 78#define SELFID_PORT_NONE 0x0
78 79
80#define PHYPACKET_LINKON 0x40000000
81#define PHYPACKET_PHYCONFIG_R 0x00800000
82#define PHYPACKET_PHYCONFIG_T 0x00400000
83#define EXTPHYPACKET_TYPE_PING 0x00000000
84#define EXTPHYPACKET_TYPE_REMOTEACCESS_BASE 0x00040000
85#define EXTPHYPACKET_TYPE_REMOTEACCESS_PAGED 0x00140000
86#define EXTPHYPACKET_TYPE_REMOTEREPLY_BASE 0x000C0000
87#define EXTPHYPACKET_TYPE_REMOTEREPLY_PAGED 0x001C0000
88#define EXTPHYPACKET_TYPE_REMOTECOMMAND 0x00200000
89#define EXTPHYPACKET_TYPE_REMOTECONFIRMATION 0x00280000
90#define EXTPHYPACKET_TYPE_RESUME 0x003C0000
79 91
80/* 1394a PHY bitmasks */ 92#define EXTPHYPACKET_TYPEMASK 0xC0FC0000
93
94#define PHYPACKET_PORT_SHIFT 24
95#define PHYPACKET_GAPCOUNT_SHIFT 16
96
97/* 1394a PHY register map bitmasks */
81#define PHY_00_PHYSICAL_ID 0xFC 98#define PHY_00_PHYSICAL_ID 0xFC
82#define PHY_00_R 0x02 /* Root */ 99#define PHY_00_R 0x02 /* Root */
83#define PHY_00_PS 0x01 /* Power Status*/ 100#define PHY_00_PS 0x01 /* Power Status*/
diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
index 32a1e016c85e..f2f5e4805b5f 100644
--- a/drivers/ieee1394/ieee1394_core.c
+++ b/drivers/ieee1394/ieee1394_core.c
@@ -256,10 +256,14 @@ static int check_selfids(struct hpsb_host *host)
256 256
257 esid = (struct ext_selfid *)(sid - 1); 257 esid = (struct ext_selfid *)(sid - 1);
258 while (esid->extended) { 258 while (esid->extended) {
259 if ((esid->porta == 0x2) || (esid->portb == 0x2) 259 if ((esid->porta == SELFID_PORT_PARENT) ||
260 || (esid->portc == 0x2) || (esid->portd == 0x2) 260 (esid->portb == SELFID_PORT_PARENT) ||
261 || (esid->porte == 0x2) || (esid->portf == 0x2) 261 (esid->portc == SELFID_PORT_PARENT) ||
262 || (esid->portg == 0x2) || (esid->porth == 0x2)) { 262 (esid->portd == SELFID_PORT_PARENT) ||
263 (esid->porte == SELFID_PORT_PARENT) ||
264 (esid->portf == SELFID_PORT_PARENT) ||
265 (esid->portg == SELFID_PORT_PARENT) ||
266 (esid->porth == SELFID_PORT_PARENT)) {
263 HPSB_INFO("SelfIDs failed root check on " 267 HPSB_INFO("SelfIDs failed root check on "
264 "extended SelfID"); 268 "extended SelfID");
265 return 0; 269 return 0;
@@ -268,7 +272,9 @@ static int check_selfids(struct hpsb_host *host)
268 } 272 }
269 273
270 sid = (struct selfid *)esid; 274 sid = (struct selfid *)esid;
271 if ((sid->port0 == 0x2) || (sid->port1 == 0x2) || (sid->port2 == 0x2)) { 275 if ((sid->port0 == SELFID_PORT_PARENT) ||
276 (sid->port1 == SELFID_PORT_PARENT) ||
277 (sid->port2 == SELFID_PORT_PARENT)) {
272 HPSB_INFO("SelfIDs failed root check"); 278 HPSB_INFO("SelfIDs failed root check");
273 return 0; 279 return 0;
274 } 280 }
@@ -303,18 +309,18 @@ static void build_speed_map(struct hpsb_host *host, int nodecount)
303 if (sid->extended) { 309 if (sid->extended) {
304 esid = (struct ext_selfid *)sid; 310 esid = (struct ext_selfid *)sid;
305 311
306 if (esid->porta == 0x3) cldcnt[n]++; 312 if (esid->porta == SELFID_PORT_CHILD) cldcnt[n]++;
307 if (esid->portb == 0x3) cldcnt[n]++; 313 if (esid->portb == SELFID_PORT_CHILD) cldcnt[n]++;
308 if (esid->portc == 0x3) cldcnt[n]++; 314 if (esid->portc == SELFID_PORT_CHILD) cldcnt[n]++;
309 if (esid->portd == 0x3) cldcnt[n]++; 315 if (esid->portd == SELFID_PORT_CHILD) cldcnt[n]++;
310 if (esid->porte == 0x3) cldcnt[n]++; 316 if (esid->porte == SELFID_PORT_CHILD) cldcnt[n]++;
311 if (esid->portf == 0x3) cldcnt[n]++; 317 if (esid->portf == SELFID_PORT_CHILD) cldcnt[n]++;
312 if (esid->portg == 0x3) cldcnt[n]++; 318 if (esid->portg == SELFID_PORT_CHILD) cldcnt[n]++;
313 if (esid->porth == 0x3) cldcnt[n]++; 319 if (esid->porth == SELFID_PORT_CHILD) cldcnt[n]++;
314 } else { 320 } else {
315 if (sid->port0 == 0x3) cldcnt[n]++; 321 if (sid->port0 == SELFID_PORT_CHILD) cldcnt[n]++;
316 if (sid->port1 == 0x3) cldcnt[n]++; 322 if (sid->port1 == SELFID_PORT_CHILD) cldcnt[n]++;
317 if (sid->port2 == 0x3) cldcnt[n]++; 323 if (sid->port2 == SELFID_PORT_CHILD) cldcnt[n]++;
318 324
319 speedcap[n] = sid->speed; 325 speedcap[n] = sid->speed;
320 n--; 326 n--;
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index b56934edd62b..f4b6025fde61 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1416,7 +1416,8 @@ static int nodemgr_send_resume_packet(struct hpsb_host *host)
1416 int ret = 1; 1416 int ret = 1;
1417 1417
1418 packet = hpsb_make_phypacket(host, 1418 packet = hpsb_make_phypacket(host,
1419 0x003c0000 | NODEID_TO_NODE(host->node_id) << 24); 1419 EXTPHYPACKET_TYPE_RESUME |
1420 NODEID_TO_NODE(host->node_id) << PHYPACKET_PORT_SHIFT);
1420 if (packet) { 1421 if (packet) {
1421 packet->no_waiter = 1; 1422 packet->no_waiter = 1;
1422 packet->generation = get_hpsb_generation(host); 1423 packet->generation = get_hpsb_generation(host);