Lines Matching refs:pkt
23 int cmd, struct cfpkt *pkt){ in handle_loop() argument
28 int cmd, struct cfpkt *pkt);
30 static int cfctrl_recv(struct cflayer *layr, struct cfpkt *pkt);
178 struct cfpkt *pkt; in cfctrl_enum_req() local
186 pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN); in cfctrl_enum_req()
187 if (!pkt) in cfctrl_enum_req()
190 init_info(cfpkt_info(pkt), cfctrl); in cfctrl_enum_req()
191 cfpkt_info(pkt)->dev_info->id = physlinkid; in cfctrl_enum_req()
193 cfpkt_addbdy(pkt, CFCTRL_CMD_ENUM); in cfctrl_enum_req()
194 cfpkt_addbdy(pkt, physlinkid); in cfctrl_enum_req()
195 cfpkt_set_prio(pkt, TC_PRIO_CONTROL); in cfctrl_enum_req()
196 dn->transmit(dn, pkt); in cfctrl_enum_req()
207 struct cfpkt *pkt; in cfctrl_linkup_request() local
225 pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN); in cfctrl_linkup_request()
226 if (!pkt) in cfctrl_linkup_request()
228 cfpkt_addbdy(pkt, CFCTRL_CMD_LINK_SETUP); in cfctrl_linkup_request()
229 cfpkt_addbdy(pkt, (param->chtype << 4) | param->linktype); in cfctrl_linkup_request()
230 cfpkt_addbdy(pkt, (param->priority << 3) | param->phyid); in cfctrl_linkup_request()
231 cfpkt_addbdy(pkt, param->endpoint & 0x03); in cfctrl_linkup_request()
237 cfpkt_addbdy(pkt, (u8) param->u.video.connid); in cfctrl_linkup_request()
243 cfpkt_add_body(pkt, &tmp32, 4); in cfctrl_linkup_request()
250 cfpkt_add_body(pkt, &tmp32, 4); in cfctrl_linkup_request()
252 cfpkt_add_body(pkt, param->u.rfm.volume, in cfctrl_linkup_request()
257 cfpkt_add_body(pkt, &tmp16, 2); in cfctrl_linkup_request()
259 cfpkt_add_body(pkt, &tmp16, 2); in cfctrl_linkup_request()
263 cfpkt_add_body(pkt, utility_name, UTILITY_NAME_LENGTH); in cfctrl_linkup_request()
265 cfpkt_add_body(pkt, &tmp8, 1); in cfctrl_linkup_request()
266 cfpkt_add_body(pkt, param->u.utility.params, in cfctrl_linkup_request()
272 cfpkt_destroy(pkt); in cfctrl_linkup_request()
277 cfpkt_destroy(pkt); in cfctrl_linkup_request()
285 init_info(cfpkt_info(pkt), cfctrl); in cfctrl_linkup_request()
291 cfpkt_info(pkt)->dev_info->id = param->phyid; in cfctrl_linkup_request()
292 cfpkt_set_prio(pkt, TC_PRIO_CONTROL); in cfctrl_linkup_request()
294 dn->transmit(dn, pkt); in cfctrl_linkup_request()
312 struct cfpkt *pkt; in cfctrl_linkdown_req() local
320 pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN); in cfctrl_linkdown_req()
321 if (!pkt) in cfctrl_linkdown_req()
323 cfpkt_addbdy(pkt, CFCTRL_CMD_LINK_DESTROY); in cfctrl_linkdown_req()
324 cfpkt_addbdy(pkt, channelid); in cfctrl_linkdown_req()
325 init_info(cfpkt_info(pkt), cfctrl); in cfctrl_linkdown_req()
326 cfpkt_set_prio(pkt, TC_PRIO_CONTROL); in cfctrl_linkdown_req()
328 dn->transmit(dn, pkt); in cfctrl_linkdown_req()
354 static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt) in cfctrl_recv() argument
366 cmdrsp = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
371 if (handle_loop(cfctrl, cmd, pkt) != 0) in cfctrl_recv()
389 tmp = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
397 tmp = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
403 endpoint = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
412 linkid = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
415 tmp = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
420 linkid = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
425 cfpkt_extr_head_u32(pkt); in cfctrl_recv()
429 linkid = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
437 cfpkt_extr_head_u32(pkt); in cfctrl_recv()
439 for (tmp = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
440 cfpkt_more(pkt) && tmp != '\0'; in cfctrl_recv()
441 tmp = cfpkt_extr_head_u8(pkt)) in cfctrl_recv()
448 linkid = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
458 cfpkt_extr_head_u16(pkt); in cfctrl_recv()
461 cfpkt_extr_head_u16(pkt); in cfctrl_recv()
468 && cfpkt_more(pkt); i++) { in cfctrl_recv()
469 tmp = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
473 len = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
477 while (cfpkt_more(pkt) && len--) { in cfctrl_recv()
478 tmp = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
484 linkid = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
486 len = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
488 cfpkt_extr_head(pkt, ¶m, len); in cfctrl_recv()
502 cfpkt_erroneous(pkt)) { in cfctrl_recv()
523 linkid = cfpkt_extr_head_u8(pkt); in cfctrl_recv()
551 cfpkt_destroy(pkt); in cfctrl_recv()
590 static int handle_loop(struct cfctrl *ctrl, int cmd, struct cfpkt *pkt) in handle_loop() argument
618 cfpkt_add_trail(pkt, &linkid, 1); in handle_loop()
620 cfpkt_peek_head(pkt, &linktype, 1); in handle_loop()
623 cfpkt_add_trail(pkt, &tmp, 1); in handle_loop()
624 cfpkt_add_trail(pkt, &tmp, 1); in handle_loop()
630 cfpkt_peek_head(pkt, &linkid, 1); in handle_loop()