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