20 #define EC_SOE_MAX_DRIVES 8
51 memset(&Ec, 0,
sizeof(Ec));
81 uint16 totalsize, framedatasize;
97 SoEp->MbxHeader.address =
htoes(0x0000);
98 SoEp->MbxHeader.priority = 0x00;
104 SoEp->incomplete = 0;
106 SoEp->driveNo = driveNo;
107 SoEp->elementflags = elementflags;
108 SoEp->idn =
htoes(idn);
126 if (((aSoEp->MbxHeader.mbxtype & 0x0f) ==
ECT_MBXT_SOE) &&
128 (aSoEp->error == 0) &&
129 (aSoEp->driveNo == driveNo) &&
130 (aSoEp->elementflags == elementflags))
133 totalsize += framedatasize;
135 if (totalsize <= *psize)
138 memcpy(bp, mp, framedatasize);
144 framedatasize -= totalsize - *psize;
147 if (framedatasize > 0) memcpy(bp, mp, framedatasize);
150 if (!aSoEp->incomplete)
160 if (((aSoEp->MbxHeader.mbxtype & 0x0f) ==
ECT_MBXT_SOE) &&
203 uint16 framedatasize, maxdata;
218 SoEp->MbxHeader.address =
htoes(0x0000);
219 SoEp->MbxHeader.priority = 0x00;
222 SoEp->driveNo = driveNo;
223 SoEp->elementflags = elementflags;
230 framedatasize = psize;
232 SoEp->idn =
htoes(idn);
233 SoEp->incomplete = 0;
234 if (framedatasize > maxdata)
236 framedatasize = maxdata;
238 SoEp->incomplete = 1;
239 SoEp->fragmentsleft = psize / maxdata;
247 memcpy(mp, hp, framedatasize);
249 psize -= framedatasize;
264 if (((aSoEp->MbxHeader.mbxtype & 0x0f) ==
ECT_MBXT_SOE) &&
266 (aSoEp->error == 0) &&
267 (aSoEp->driveNo == driveNo) &&
268 (aSoEp->elementflags == elementflags))
275 if (((aSoEp->MbxHeader.mbxtype & 0x0f) ==
ECT_MBXT_SOE) &&
318 uint16 entries, itemcount;
326 psize =
sizeof(SoEmapping);
329 if ((
wkc > 0) && (psize >= 4) && ((entries =
etohs(SoEmapping.currentlength) / 2) > 0) && (entries <=
EC_SOE_MAXMAPPING))
333 for (itemcount = 0 ; itemcount < entries ; itemcount++)
335 psize =
sizeof(SoEattribute);
338 if ((
wkc > 0) && (!SoEattribute.list))
341 *Osize += (int)8 << SoEattribute.length;
345 psize =
sizeof(SoEmapping);
348 if ((
wkc > 0) && (psize >= 4) && ((entries =
etohs(SoEmapping.currentlength) / 2) > 0) && (entries <=
EC_SOE_MAXMAPPING))
352 for (itemcount = 0 ; itemcount < entries ; itemcount++)
354 psize =
sizeof(SoEattribute);
357 if ((
wkc > 0) && (!SoEattribute.list))
360 *Isize += (int)8 << SoEattribute.length;
367 if ((*Isize > 0) || (*Osize > 0))