Lines Matching defs:tuple
142 struct pcmcia_tuple tuple;
168 /* initialize state for the primary tuple chain */
170 PCMCIA_CIS_SIZE, &pcmh, &tuple.ptr, &window)) {
178 tuple.memt = pcmh.memt;
179 tuple.memh = pcmh.memh;
181 DPRINTF(("cis mem map %x\n", (unsigned int) tuple.memh));
183 tuple.mult = 2;
192 DPRINTF(("%s: CIS tuple chain:\n", device_xname(sc->dev)));
204 if (tuple.mult * tuple.ptr >= PCMCIA_CIS_SIZE - 1
207 tuple.code = PCMCIA_CISTPL_END;
211 /* get the tuple code */
213 tuple.code = pcmcia_cis_read_1(&tuple, tuple.ptr);
217 if (tuple.code == PCMCIA_CISTPL_NULL) {
219 tuple.ptr++;
221 } else if (tuple.code == PCMCIA_CISTPL_END) {
224 /* Call the function for the END tuple, since
226 if ((*fct) (&tuple, arg)) {
232 tuple.ptr++;
238 tuple.length = pcmcia_cis_read_1(&tuple, tuple.ptr + 1);
240 /* print the tuple */
244 DPRINTF((" %02x %02x", tuple.code,
245 tuple.length));
247 for (i = 0; i < tuple.length; i++) {
249 pcmcia_tuple_read_1(&tuple, i)));
257 switch (tuple.code) {
260 if (tuple.length < 4) {
264 tuple.length));
268 longlink_common = (tuple.code ==
270 longlink_addr = pcmcia_tuple_read_4(&tuple, 0);
280 if (tuple.length < 5) {
282 "short %d\n", tuple.length));
291 pcmcia_tuple_read_2(&tuple, 0);
292 length = pcmcia_tuple_read_2(&tuple, 2);
293 cksum = pcmcia_tuple_read_1(&tuple, 4);
295 addr = tuple.ptr + offset;
318 bus_space_read_1(tuple.memt,
319 tuple.memh,
320 addr + tuple.mult * i);
339 if (tuple.length < 1) {
341 "short %d\n", tuple.length));
344 if (((tuple.length - 1) % 5) != 0) {
346 "length %d\n", tuple.length));
363 pcmcia_tuple_read_1(&tuple, 0);
372 if (tuple.length != (tmp_count*5 + 1)) {
374 tuple.length));
393 (pcmcia_tuple_read_1(&tuple,
398 pcmcia_tuple_read_4(&tuple,
408 * function. This tuple has structural and
414 if ((*fct) (&tuple, arg)) {
423 /* skip to the next tuple */
424 tuple.ptr += 2 + tuple.length;
456 &pcmh, &tuple.ptr, &window);
458 tuple.memt = pcmh.memt;
459 tuple.memh = pcmh.memh;
462 tuple.ptr /= 2;
465 (unsigned int) tuple.memh));
467 tuple.mult = longlink_common ? 1 : 2;
480 &pcmh, &tuple.ptr, &window);
483 tuple.ptr /= 2;
486 (unsigned int) tuple.memh));
490 tuple.mult = mfc[mfc_index].common ? 1 : 2;
498 tuple.code = pcmcia_cis_read_1(&tuple, tuple.ptr);
499 if (tuple.code != PCMCIA_CISTPL_LINKTARGET) {
501 "code %02x observed\n", tuple.code));
504 tuple.length = pcmcia_cis_read_1(&tuple, tuple.ptr + 1);
505 if (tuple.length < 3) {
507 tuple.length));
510 if ((pcmcia_tuple_read_1(&tuple, 0) != 'C') ||
511 (pcmcia_tuple_read_1(&tuple, 1) != 'I') ||
512 (pcmcia_tuple_read_1(&tuple, 2) != 'S')) {
515 pcmcia_tuple_read_1(&tuple, 0),
516 pcmcia_tuple_read_1(&tuple, 1),
517 pcmcia_tuple_read_1(&tuple, 2)));
520 tuple.ptr += 2 + tuple.length;
708 pcmcia_parse_cis_tuple(struct pcmcia_tuple *tuple, void *arg)
712 switch (tuple->code) {
714 decode_end(tuple, state);
718 decode_longlink_mfc(tuple, state);
723 decode_device(tuple, state);
727 decode_vers_1(tuple, state);
731 decode_manfid(tuple, state);
735 decode_funcid(tuple, state);
739 decode_funce(tuple, state);
743 decode_config(tuple, state);
747 decode_cftable_entry(tuple, state);
750 DPRINTF(("unhandled CISTPL %x\n", tuple->code));
758 decode_end(struct pcmcia_tuple *tuple, struct cis_state *state)
780 decode_longlink_mfc(struct pcmcia_tuple *tuple,
784 * this tuple's structure was dealt with in scan_cis. here,
785 * record the fact that the MFC tuple was seen, so that
797 decode_device(struct pcmcia_tuple *tuple,
803 reg = pcmcia_tuple_read_1(tuple, 0);
808 (tuple->code == PCMCIA_CISTPL_DEVICE) ? "" : "_A"));
873 decode_vers_1(struct pcmcia_tuple *tuple, struct cis_state *state)
877 if (tuple->length < 6) {
879 tuple->length));
882 state->card->cis1_major = pcmcia_tuple_read_1(tuple, 0);
883 state->card->cis1_minor = pcmcia_tuple_read_1(tuple, 1);
887 ch = pcmcia_tuple_read_1(tuple, 2 + i);
908 decode_manfid(struct pcmcia_tuple *tuple, struct cis_state *state)
910 if (tuple->length < 4) {
912 tuple->length));
915 state->card->manufacturer = pcmcia_tuple_read_2(tuple, 0);
916 state->card->product = pcmcia_tuple_read_2(tuple, 2);
921 decode_funcid(struct pcmcia_tuple *tuple, struct cis_state *state)
923 if (tuple->length < 1) {
925 tuple->length));
932 * created by a CONFIG tuple. Just keep it.
943 state->pf->function = pcmcia_tuple_read_1(tuple, 0);
949 decode_funce(struct pcmcia_tuple *tuple, struct cis_state *state)
952 int type = pcmcia_tuple_read_1(tuple, 0);
959 if (tuple->length < 2)
965 = pcmcia_tuple_read_1(tuple, 1);
971 int len = pcmcia_tuple_read_1(tuple, 1);
972 if (tuple->length < 2 + len || len > 8) {
973 /* tuple length not enough or nid too long */
978 = pcmcia_tuple_read_1(tuple, 2 + i);
991 decode_config(struct pcmcia_tuple *tuple, struct cis_state *state)
1003 if (tuple->length < 3) {
1004 DPRINTF(("CISTPL_CONFIG too short %d\n", tuple->length));
1007 reg = pcmcia_tuple_read_1(tuple, 0);
1015 if (tuple->length < (rasz + rmsz + rfsz)) {
1017 rasz, rmsz, rfsz, tuple->length));
1025 pcmcia_tuple_read_1(tuple, 1);
1029 state->pf->ccr_base |= ((pcmcia_tuple_read_1(tuple, 2 + i)) <<
1034 state->pf->ccr_mask |= ((pcmcia_tuple_read_1(tuple,
1046 decode_cftable_entry(struct pcmcia_tuple *tuple, struct cis_state *state)
1056 reg = pcmcia_tuple_read_1(tuple, idx);
1132 reg = pcmcia_tuple_read_1(tuple, idx);
1148 reg = pcmcia_tuple_read_1(tuple, idx);
1162 reg = pcmcia_tuple_read_1(tuple, idx);
1170 reg2 = pcmcia_tuple_read_1(tuple, idx);
1185 reg = pcmcia_tuple_read_1(tuple, idx);
1199 if (tuple->length <= idx) {
1204 reg = pcmcia_tuple_read_1(tuple, idx);
1217 reg = pcmcia_tuple_read_1(tuple, idx);
1240 pcmcia_tuple_read_1(tuple, idx);
1245 pcmcia_tuple_read_2(tuple, idx);
1250 pcmcia_tuple_read_4(tuple, idx);
1262 pcmcia_tuple_read_1(tuple, idx);
1267 pcmcia_tuple_read_2(tuple, idx);
1272 pcmcia_tuple_read_4(tuple, idx);
1286 if (tuple->length <= idx) {
1291 reg = pcmcia_tuple_read_1(tuple, idx);
1311 pcmcia_tuple_read_2(tuple, idx);
1323 if (tuple->length <= idx) {
1338 pcmcia_tuple_read_2(tuple, idx);
1347 pcmcia_tuple_read_2(tuple, idx);
1350 pcmcia_tuple_read_2(tuple, idx);
1357 reg = pcmcia_tuple_read_1(tuple, idx);
1390 pcmcia_tuple_read_n(tuple,
1404 pcmcia_tuple_read_n(tuple,
1413 pcmcia_tuple_read_n(tuple,
1424 if (tuple->length <= idx) {
1429 reg = pcmcia_tuple_read_1(tuple, idx);
1444 reg = pcmcia_tuple_read_1(tuple, idx);