FreeBSD/Linux Kernel Cross Reference
sys/dev/ieee1394/NOTES
1 SBP2 SCSI notes:
2
3 sbp *sbp_init(dir node *, int numorbs)
4 int sbp_runcmd(sbp *, sbp_cmd *);
5 orb *sbp_construct_orb(data *, orb data *, void *callback, cbarg)
6 void sbp_free(sbp *);
7
8 cmd - u_int8_t cmd[12]
9 int cmdlen
10 u_char *data
11 int datalen (0 if data uio)
12 u_int16_t lun;
13 int r/w
14 void (*cb)(void *, sbp2_status *)
15 void *cb_arg
16
17 status -
18
19 u_int8_t resp;
20 u_int8_t sbp_status;
21 u_int8_t object;
22 u_int8_t serial_error;
23 u_int32_t *data
24 u_int16_t datalen;
25
26 crc check
27
28 status orb
29
30 src
31 resp
32 dead
33 len
34 sbp status
35 u_int32_t *data
36
37 sbp2 management struct:
38
39 struct ieee1394_softc *dev
40 mgmt register
41 csr regs
42 loginid
43 speed
44 maxpayload
45 mgmt orb timeout
46 orb size
47 sbp state
48
49 orb:
50
51 *need addr for orb address range
52 *need addr for data address range
53 *need addr for page table address range
54
55 abuf *
56 abuf count
57 inuse
58 void *request
59
60 fwscsi:
61
62 sbp2 struct
63 orb *
64 orbcount
65
66 init sbp2 (ieeesoftc and sbp2 struct)
67
68 send login packet
69 setup handlers for login resp
70 and status fifo
71
72 get login resp and clear handler
73 get status but leave handler for unsolicated responses.
74
75 login resp has mgmt registers pointer, save it
76 also contains login id, save it
77
78 setup dummy orb and get agent ready by having it fetch this
79
80 return dummy orb or NULL on error
81
82 scsi-init
83
84 setup generic status callback
85
86 request -
87 Accept packet through request routine
88
89 examine packet for data vs. cmd
90
91 cmd:
92
93 construct orb with no data addr
94
95 data:
96
97 determine direction bit
98
99 examine packet for uio vs direct map:
100
101 direct map:
102
103 setup read callback if <= 64k in size
104
105 else setup uio and do uio
106
107 uio:
108
109 setup unrestricted page table in 64k chunks
110 setup callback for each chunk
111 setup callback for page table
112
113 find current end of orb chain
114 DIAG - make sure there's room for a new orb
115 add new orb into chain
116 setup callback to read that orb
117 ring doorbell
118
119 status callback - mark orb as not in use, pull data and call scsipi_done with
120 status
121 unregister all callback associated with orb
122
123 extend orbs -
124
125 allocate more orb pointers
126
127
128 config rom -
129
130 a typical match routine will
131
132 find_type(type code) == X type
133 find_type(type code) == X type
134 ...
135
136 ex
137
138 find_type(unit spec id) == sbp2
139 find_type(unit sw version) == scsi
140
141 in attach:
142
143 call sbp2_register_print for unit directory -- fwscsi_rom_print
144 direcotory entries need print callback pointer
145
Cache object: b2592e0a40606f93af1ba5b71c8ca8de
|