Lines Matching refs:tp

73 cis_get_short(cistpl_t *tp)  in cis_get_short()  argument
77 if (tp->flags & CISTPLF_AM_SPACE) { in cis_get_short()
78 result = GET_AM_BYTE(tp); in cis_get_short()
79 result |= GET_AM_BYTE(tp) << 8; in cis_get_short()
81 result = GET_CM_BYTE(tp); in cis_get_short()
82 result |= GET_CM_BYTE(tp) << 8; in cis_get_short()
88 cis_get_be_short(cistpl_t *tp) in cis_get_be_short() argument
92 if (tp->flags & CISTPLF_AM_SPACE) { in cis_get_be_short()
93 result = GET_AM_BYTE(tp) << 8; in cis_get_be_short()
94 result |= GET_AM_BYTE(tp); in cis_get_be_short()
96 result = GET_CM_BYTE(tp) << 8; in cis_get_be_short()
97 result |= GET_CM_BYTE(tp); in cis_get_be_short()
103 cis_get_int24(cistpl_t *tp) in cis_get_int24() argument
105 uint32_t result = cis_get_short(tp); in cis_get_int24()
107 result |= GET_BYTE(tp) << 16; in cis_get_int24()
112 cis_get_long(cistpl_t *tp) in cis_get_long() argument
114 uint32_t result = cis_get_short(tp); in cis_get_long()
116 result |= cis_get_short(tp) << 16; in cis_get_long()
150 cis_tuple_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags, in cis_tuple_handler() argument
156 if (CISTPL_IS_VENDOR_SPECIFIC(tp->type)) in cis_tuple_handler()
157 tp->flags |= CISTPLF_VENDOR_SPECIFIC; in cis_tuple_handler()
165 if (co->type == tp->type && in cis_tuple_handler()
166 ((tp->type != CISTPL_FUNCE) || in cis_tuple_handler()
167 (tp->type == CISTPL_FUNCE && co->subtype == subtype))) { in cis_tuple_handler()
168 tp->flags &= ~CISTPLF_UNKNOWN; in cis_tuple_handler()
173 return ((*co->handler) (co, tp, flags, arg)); in cis_tuple_handler()
191 tp->flags |= CISTPLF_UNKNOWN; in cis_tuple_handler()
218 cis_no_tuple_handler(cistpl_callout_t *co, cistpl_t *tp, in cis_no_tuple_handler() argument
222 tp->flags |= co->flags; /* XXX - is = the right thing here? */ in cis_no_tuple_handler()
223 if (tp->len > 0) in cis_no_tuple_handler()
224 tp->flags |= CISTPLF_COPYOK; in cis_no_tuple_handler()
228 tp->flags |= CISTPLF_VALID; in cis_no_tuple_handler()
257 cis_unknown_tuple_handler(cistpl_callout_t *co, cistpl_t *tp, in cis_unknown_tuple_handler() argument
261 tp->flags |= co->flags; /* XXX - is = the right thing here? */ in cis_unknown_tuple_handler()
266 tp->flags |= CISTPLF_VALID; in cis_unknown_tuple_handler()
280 cistpl_vers_1_handler(cistpl_callout_t *co, cistpl_t *tp, in cistpl_vers_1_handler() argument
288 return (cis_no_tuple_handler(co, tp, flags, arg)); in cistpl_vers_1_handler()
295 return (cis_no_tuple_handler(co, tp, flags, arg)); in cistpl_vers_1_handler()
301 RESET_TP(tp); in cistpl_vers_1_handler()
303 cs->major = GET_BYTE(tp); in cistpl_vers_1_handler()
304 cs->minor = GET_BYTE(tp); in cistpl_vers_1_handler()
305 for (cs->ns = 0; GET_LEN(tp) > 0 && in cistpl_vers_1_handler()
308 (void) strcpy(cs->pi[cs->ns++], cis_getstr(tp)); in cistpl_vers_1_handler()
343 cistpl_config_handler(cistpl_callout_t *co, cistpl_t *tp, in cistpl_config_handler() argument
354 return (cis_no_tuple_handler(co, tp, flags, arg)); in cistpl_config_handler()
361 return (cis_no_tuple_handler(co, tp, flags, arg)); in cistpl_config_handler()
367 RESET_TP(tp); in cistpl_config_handler()
369 tpcc_sz = GET_BYTE(tp); /* config regs size fields */ in cistpl_config_handler()
370 cr->last = GET_BYTE(tp); /* last config index */ in cistpl_config_handler()
384 cr->base |= ((GET_BYTE(tp) & 0x0ff) << in cistpl_config_handler()
400 if (LOOK_BYTE(tp) & (1<<i)) { in cistpl_config_handler()
412 (void) GET_BYTE(tp); in cistpl_config_handler()
430 cistpl_device_handler(cistpl_callout_t *co, cistpl_t *tp, in cistpl_device_handler() argument
440 return (cis_no_tuple_handler(co, tp, flags, arg)); in cistpl_device_handler()
447 return (cis_no_tuple_handler(co, tp, flags, arg)); in cistpl_device_handler()
464 RESET_TP(tp); in cistpl_device_handler()
466 dev_id = GET_BYTE(tp); in cistpl_device_handler()
475 cdn->nS_speed = cistpl_devspeed(tp, 0, CISTPL_DEVSPEED_EXT); in cistpl_device_handler()
504 cdn->size = GET_BYTE(tp); in cistpl_device_handler()
531 cistpl_cftable_handler(cistpl_callout_t *co, cistpl_t *tp, argument
543 return (cis_no_tuple_handler(co, tp, flags, arg));
550 return (cis_no_tuple_handler(co, tp, flags, arg));
555 RESET_TP(tp);
565 if ((tpce_indx = GET_BYTE(tp)) & CISTPL_CFTABLE_TPCE_IFM) {
566 ce->ifc = GET_BYTE(tp);
593 tpce_fs = GET_BYTE(tp);
635 cistpl_pd_parse(tp, pwr);
642 cistpl_pd_parse(tp, pwr);
649 cistpl_pd_parse(tp, pwr);
663 tpce_td = GET_BYTE(tp);
673 sp->nS_wait = cistpl_devspeed(tp,
686 sp->nS_rdybsy = cistpl_devspeed(tp,
700 sp->nS_rsvd = cistpl_devspeed(tp,
722 tpce_io = GET_BYTE(tp);
736 ior_desc = GET_BYTE(tp);
763 ior->addr |= (GET_BYTE(tp) <<
775 ior->length |= (GET_BYTE(tp) <<
790 tpce_ir = GET_BYTE(tp);
801 irq->irqs = GET_BYTE(tp) & 0x0ff;
802 irq->irqs |= (GET_BYTE(tp) << 8)&0x0ff00;
827 tpce_msd = GET_BYTE(tp);
855 win->length |= (GET_BYTE(tp) <<
867 (GET_BYTE(tp) <<
893 (GET_BYTE(tp) <<
916 win->length = GET_BYTE(tp);
917 win->length |= (GET_BYTE(tp)<<8);
924 win->card_addr = GET_BYTE(tp);
925 win->card_addr |= (GET_BYTE(tp)<<8);
947 win->length = GET_BYTE(tp);
948 win->length |= (GET_BYTE(tp)<<8);
977 misc->flags = (misc->flags << 8) | LOOK_BYTE(tp);
980 } while ((GET_BYTE(tp) & CISTPL_EXT_BIT) &&
981 (!(tp->flags & CISTPLF_MEM_ERR)));
989 if (tp->flags & CISTPLF_MEM_ERR)
1005 if (GET_LEN(tp) > 0) {
1024 cistpl_pd_parse(cistpl_t *tp, cistpl_cftable_entry_pwr_t *pd)
1028 pdesc = GET_BYTE(tp); /* power description selector */
1032 pd->nomV = cistpl_expd_parse(tp, &pd->nomV_flags) / 100;
1038 pd->minV = cistpl_expd_parse(tp, &pd->minV_flags) / 100;
1044 pd->maxV = cistpl_expd_parse(tp, &pd->maxV_flags) / 100;
1051 pd->staticI = cistpl_expd_parse(tp, &pd->staticI_flags);
1058 pd->avgI = cistpl_expd_parse(tp, &pd->avgI_flags);
1065 pd->peakI = cistpl_expd_parse(tp, &pd->peakI_flags);
1072 pd->pdownI = cistpl_expd_parse(tp, &pd->pdownI_flags);
1095 cistpl_expd_parse(cistpl_t *tp, uint32_t *flags)
1104 pdesc = GET_BYTE(tp);
1110 if (LOOK_BYTE(tp) <= 0x63)
1111 digits = LOOK_BYTE(tp);
1112 if (LOOK_BYTE(tp) == CISTPL_CFTABLE_PD_NC_SLEEPM)
1114 if (LOOK_BYTE(tp) == CISTPL_CFTABLE_PD_ZEROM)
1116 if (LOOK_BYTE(tp) == CISTPL_CFTABLE_PD_NCM)
1118 } while (GET_BYTE(tp) & CISTPL_EXT_BIT);
1174 cistpl_devspeed(cistpl_t *tp, cisdata_t spindex, uint32_t flags)
1187 exspeed = GET_BYTE(tp);
1219 cistpl_vers_2_handler(cistpl_callout_t *co, cistpl_t *tp,
1227 return (cis_no_tuple_handler(co, tp, flags, arg));
1234 return (cis_no_tuple_handler(co, tp, flags, arg));
1239 RESET_TP(tp);
1241 cs->vers = GET_BYTE(tp);
1242 cs->comply = GET_BYTE(tp);
1243 cs->dindex = GET_SHORT(tp);
1245 cs->reserved = GET_SHORT(tp);
1247 cs->vspec8 = GET_BYTE(tp);
1248 cs->vspec9 = GET_BYTE(tp);
1249 cs->nhdr = GET_BYTE(tp);
1251 (void) strcpy(cs->oem, cis_getstr(tp));
1253 if (GET_LEN(tp) > 0)
1254 (void) strcpy(cs->info, cis_getstr(tp));
1268 cistpl_jedec_handler(cistpl_callout_t *co, cistpl_t *tp,
1276 return (cis_no_tuple_handler(co, tp, flags, arg));
1283 return (cis_no_tuple_handler(co, tp, flags, arg));
1289 RESET_TP(tp);
1291 for (nid = 0; GET_LEN(tp) > 0 &&
1293 LOOK_BYTE(tp) != 0xFF; nid++) {
1294 cs->jid[nid].id = GET_BYTE(tp);
1295 cs->jid[nid].info = GET_BYTE(tp);
1308 cistpl_format_handler(cistpl_callout_t *co, cistpl_t *tp,
1316 return (cis_no_tuple_handler(co, tp, flags, arg));
1323 return (cis_no_tuple_handler(co, tp, flags, arg));
1328 RESET_TP(tp);
1330 cs->type = GET_BYTE(tp);
1331 cs->edc_length = LOOK_BYTE(tp) & EDC_LENGTH_MASK;
1332 cs->edc_type = ((uint32_t)GET_BYTE(tp) >> EDC_TYPE_SHIFT) &
1334 cs->offset = GET_LONG(tp);
1335 cs->nbytes = GET_LONG(tp);
1339 cs->dev.disk.bksize = GET_SHORT(tp);
1340 cs->dev.disk.nblocks = GET_LONG(tp);
1341 cs->dev.disk.edcloc = GET_LONG(tp);
1345 cs->dev.mem.flags = GET_BYTE(tp);
1346 cs->dev.mem.reserved = GET_BYTE(tp);
1347 cs->dev.mem.address = (caddr_t)(uintptr_t)GET_LONG(tp);
1348 cs->dev.disk.edcloc = GET_LONG(tp);
1365 cistpl_geometry_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
1373 return (cis_no_tuple_handler(co, tp, flags, arg));
1380 return (cis_no_tuple_handler(co, tp, flags, arg));
1385 RESET_TP(tp);
1386 cs->spt = GET_BYTE(tp);
1387 cs->tpc = GET_BYTE(tp);
1388 cs->ncyl = GET_SHORT(tp);
1399 cistpl_byteorder_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
1407 return (cis_no_tuple_handler(co, tp, flags, arg));
1414 return (cis_no_tuple_handler(co, tp, flags, arg));
1419 RESET_TP(tp);
1420 cs->order = GET_BYTE(tp);
1421 cs->map = GET_BYTE(tp);
1433 cistpl_date_handler(cistpl_callout_t *co, cistpl_t *tp,
1441 return (cis_no_tuple_handler(co, tp, flags, arg));
1448 return (cis_no_tuple_handler(co, tp, flags, arg));
1453 RESET_TP(tp);
1454 cs->time = GET_SHORT(tp);
1455 cs->day = GET_SHORT(tp);
1468 cistpl_battery_handler(cistpl_callout_t *co, cistpl_t *tp,
1476 return (cis_no_tuple_handler(co, tp, flags, arg));
1483 return (cis_no_tuple_handler(co, tp, flags, arg));
1488 RESET_TP(tp);
1489 cs->rday = GET_SHORT(tp);
1490 cs->xday = GET_SHORT(tp);
1502 cistpl_org_handler(cistpl_callout_t *co, cistpl_t *tp,
1510 return (cis_no_tuple_handler(co, tp, flags, arg));
1517 return (cis_no_tuple_handler(co, tp, flags, arg));
1522 RESET_TP(tp);
1523 cs->type = GET_BYTE(tp);
1525 (void) strcpy(cs->desc, cis_getstr(tp));
1538 cistpl_manfid_handler(cistpl_callout_t *co, cistpl_t *tp,
1546 return (cis_no_tuple_handler(co, tp, flags, arg));
1553 return (cis_no_tuple_handler(co, tp, flags, arg));
1558 RESET_TP(tp);
1559 cs->manf = GET_SHORT(tp);
1560 cs->card = GET_SHORT(tp);
1571 cistpl_funcid_handler(cistpl_callout_t *co, cistpl_t *tp,
1579 return (cis_no_tuple_handler(co, tp, flags, arg));
1586 return (cis_no_tuple_handler(co, tp, flags, arg));
1591 RESET_TP(tp);
1593 cs->function = GET_BYTE(tp);
1594 cs->sysinit = GET_BYTE(tp);
1606 cistpl_funce_serial_handler(cistpl_callout_t *co, cistpl_t *tp,
1616 return (cis_no_tuple_handler(co, tp, flags, arg));
1623 return (cis_no_tuple_handler(co, tp, flags, arg));
1628 RESET_TP(tp);
1631 cs->subfunction = subfunction = GET_BYTE(tp);
1637 cs->data.serial.ua = GET_BYTE(tp);
1638 cs->data.serial.uc = GET_SHORT(tp);
1644 cs->data.modem.fc = GET_BYTE(tp);
1645 cs->data.modem.cb = (GET_BYTE(tp) + 1) * 4;
1646 cs->data.modem.eb = GET_INT24(tp);
1647 cs->data.modem.tb = GET_INT24(tp);
1650 cs->data.data_modem.ud = GET_BE_SHORT(tp) * 75;
1651 cs->data.data_modem.ms = GET_SHORT(tp);
1652 cs->data.data_modem.em = GET_BYTE(tp);
1653 cs->data.data_modem.dc = GET_BYTE(tp);
1654 cs->data.data_modem.cm = GET_BYTE(tp);
1655 cs->data.data_modem.ex = GET_BYTE(tp);
1656 cs->data.data_modem.dy = GET_BYTE(tp);
1657 cs->data.data_modem.ef = GET_BYTE(tp);
1659 GET_LEN(tp) > 0 && cs->data.data_modem.ncd < 16;
1661 if (LOOK_BYTE(tp) != 255) {
1664 GET_BYTE(tp);
1666 GET_BYTE(tp);
1671 cs->data.fax.uf = GET_BE_SHORT(tp) * 75;
1672 cs->data.fax.fm = GET_BYTE(tp);
1673 cs->data.fax.fy = GET_BYTE(tp);
1674 cs->data.fax.fs = GET_SHORT(tp);
1676 GET_LEN(tp) > 0 && cs->data.fax.ncf < 16;
1678 if (LOOK_BYTE(tp) != 255) {
1680 GET_BYTE(tp);
1682 GET_BYTE(tp);
1687 cs->data.voice.uv = GET_BE_SHORT(tp) * 75;
1688 for (cs->data.voice.nsr = 0; LOOK_BYTE(tp) != 0 &&
1689 GET_LEN(tp) >= 2;
1692 GET_BYTE(tp) * 1000;
1694 GET_BYTE(tp) * 100;
1696 for (cs->data.voice.nss = 0; LOOK_BYTE(tp) != 0 &&
1697 GET_LEN(tp) >= 2;
1700 GET_BYTE(tp) * 10;
1702 GET_BYTE(tp);
1704 for (cs->data.voice.nsc = 0; LOOK_BYTE(tp) != 0 &&
1705 GET_LEN(tp) >= 1;
1708 GET_BYTE(tp);
1724 cistpl_funce_lan_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
1734 return (cis_no_tuple_handler(co, tp, flags, arg));
1741 return (cis_no_tuple_handler(co, tp, flags, arg));
1747 RESET_TP(tp);
1750 cs->subfunction = subfunction = GET_BYTE(tp);
1754 cs->data.lan.tech = GET_BYTE(tp);
1755 cs->data.lan.speed = GET_BYTE(tp);
1756 i = GET_BYTE(tp);
1769 cs->data.lan.media = GET_BYTE(tp);
1770 cs->data.lan.con = GET_BYTE(tp);
1771 cs->data.lan.id_sz = GET_BYTE(tp);
1774 cs->data.lan.id[i] = GET_BYTE(tp);
1813 cistpl_linktarget_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
1821 return (cis_no_tuple_handler(co, tp, flags, arg));
1832 if ((tl = tp->len) >= (cisdata_t)MIN_LINKTARGET_LENGTH) {
1836 RESET_TP(tp);
1843 cp = GET_BYTE_ADDR(tp);
1855 if (GET_BYTE(tp) != *ltm++) {
1856 tp->flags |= CISTPLF_PARAMS_INVALID;
1865 tp->flags |= CISTPLF_VALID;
1884 tp->flags |= CISTPLF_LINK_INVALID;
1919 cistpl_longlink_ac_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
1927 return (cis_no_tuple_handler(co, tp, flags, arg));
1936 if (tp->len >= (cisdata_t)MIN_LONGLINK_AC_LENGTH) {
1942 tp->flags |= CISTPLF_VALID;
1948 switch (tp->type) {
1960 RESET_TP(tp);
1962 cs->tpll_addr = GET_LONG(tp);
1967 tp->flags |= CISTPLF_LINK_INVALID;
2000 cistpl_longlink_mfc_handler(cistpl_callout_t *co, cistpl_t *tp,
2008 return (cis_no_tuple_handler(co, tp, flags, arg));
2017 if (tp->len >= (cisdata_t)MIN_LONGLINK_MFC_LENGTH) {
2023 tp->flags |= CISTPLF_VALID;
2030 RESET_TP(tp);
2041 cs->nregs = GET_BYTE(tp);
2046 tp->flags |= CISTPLF_PARAMS_INVALID;
2055 cs->function[fn].tas = GET_BYTE(tp);
2056 cs->function[fn].addr = GET_LONG(tp);
2062 tp->flags |= CISTPLF_LINK_INVALID;
2131 cis_getstr(cistpl_t *tp)
2136 cp = tp->read.byte;
2139 while ((x = LOOK_BYTE(tp)) != 0 && x != 0xff) {
2140 x = GET_BYTE(tp);
2143 (void) GET_BYTE(tp); /* get past that last byte */