Lines Matching refs:sdp

291 	struct f_sdp *sdp = req->context;  in sdp_rx_command_complete()  local
314 sdp->always_send_status = false; in sdp_rx_command_complete()
315 sdp->error_status = 0x0; in sdp_rx_command_complete()
317 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_command_complete()
318 sdp->dnl_address = be32_to_cpu(cmd->addr); in sdp_rx_command_complete()
319 sdp->dnl_bytes_remaining = be32_to_cpu(cmd->cnt); in sdp_rx_command_complete()
320 sdp->next_state = SDP_STATE_TX_REGISTER; in sdp_rx_command_complete()
322 sdp->dnl_bytes_remaining, sdp->dnl_address); in sdp_rx_command_complete()
325 sdp->always_send_status = true; in sdp_rx_command_complete()
326 sdp->error_status = SDP_WRITE_FILE_COMPLETE; in sdp_rx_command_complete()
328 sdp->state = SDP_STATE_RX_FILE_DATA; in sdp_rx_command_complete()
329 sdp->dnl_address = cmd->addr ? be32_to_cpu(cmd->addr) : CONFIG_SDP_LOADADDR; in sdp_rx_command_complete()
330 sdp->dnl_bytes_remaining = be32_to_cpu(cmd->cnt); in sdp_rx_command_complete()
331 sdp->dnl_bytes = sdp->dnl_bytes_remaining; in sdp_rx_command_complete()
332 sdp->next_state = SDP_STATE_IDLE; in sdp_rx_command_complete()
335 sdp->dnl_bytes_remaining, sdp->dnl_address); in sdp_rx_command_complete()
339 sdp->always_send_status = true; in sdp_rx_command_complete()
340 sdp->error_status = 0; in sdp_rx_command_complete()
342 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_command_complete()
343 sdp->next_state = SDP_STATE_IDLE; in sdp_rx_command_complete()
346 sdp->always_send_status = true; in sdp_rx_command_complete()
347 sdp->error_status = SDP_WRITE_REGISTER_COMPLETE; in sdp_rx_command_complete()
349 sdp->state = SDP_STATE_RX_DCD_DATA; in sdp_rx_command_complete()
350 sdp->dnl_bytes_remaining = be32_to_cpu(cmd->cnt); in sdp_rx_command_complete()
351 sdp->next_state = SDP_STATE_IDLE; in sdp_rx_command_complete()
354 sdp->always_send_status = false; in sdp_rx_command_complete()
355 sdp->error_status = 0; in sdp_rx_command_complete()
357 sdp->jmp_address = cmd->addr ? be32_to_cpu(cmd->addr) : CONFIG_SDP_LOADADDR; in sdp_rx_command_complete()
358 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_command_complete()
359 sdp->next_state = SDP_STATE_JUMP; in sdp_rx_command_complete()
362 sdp->always_send_status = true; in sdp_rx_command_complete()
363 sdp->error_status = SDP_SKIP_DCD_HEADER_COMPLETE; in sdp_rx_command_complete()
366 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_command_complete()
367 sdp->next_state = SDP_STATE_IDLE; in sdp_rx_command_complete()
376 struct f_sdp *sdp = req->context; in sdp_rx_data_complete() local
392 if (sdp->dnl_bytes_remaining < datalen) { in sdp_rx_data_complete()
398 sdp->dnl_bytes_remaining = 0; in sdp_rx_data_complete()
400 sdp->dnl_bytes_remaining -= datalen; in sdp_rx_data_complete()
403 if (sdp->state == SDP_STATE_RX_FILE_DATA_BUSY) { in sdp_rx_data_complete()
404 memcpy(sdp_ptr(sdp->dnl_address), req->buf + 1, datalen); in sdp_rx_data_complete()
405 sdp->dnl_address += datalen; in sdp_rx_data_complete()
408 if (sdp->dnl_bytes_remaining) { in sdp_rx_data_complete()
409 sdp->state = SDP_STATE_RX_FILE_DATA; in sdp_rx_data_complete()
414 env_set_hex("filesize", sdp->dnl_bytes); in sdp_rx_data_complete()
418 switch (sdp->state) { in sdp_rx_data_complete()
420 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_data_complete()
423 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_data_complete()
426 pr_err("Invalid state: %d\n", sdp->state); in sdp_rx_data_complete()
432 struct f_sdp *sdp = req->context; in sdp_tx_complete() local
440 switch (sdp->state) { in sdp_tx_complete()
443 if (sdp->always_send_status || sdp->error_status) in sdp_tx_complete()
444 sdp->state = SDP_STATE_TX_STATUS; in sdp_tx_complete()
446 sdp->state = sdp->next_state; in sdp_tx_complete()
450 sdp->state = sdp->next_state; in sdp_tx_complete()
453 if (sdp->dnl_bytes_remaining) in sdp_tx_complete()
454 sdp->state = SDP_STATE_TX_REGISTER; in sdp_tx_complete()
456 sdp->state = SDP_STATE_IDLE; in sdp_tx_complete()
459 pr_err("Wrong State: %d\n", sdp->state); in sdp_tx_complete()
460 sdp->state = SDP_STATE_IDLE; in sdp_tx_complete()
471 struct f_sdp *sdp = f->config->cdev->req->context; in sdp_setup() local
479 req_type, ctrl->bRequest, sdp->state); in sdp_setup()
486 sdp->configuration_done = true; in sdp_setup()
528 struct f_sdp *sdp = func_to_sdp(f); in sdp_bind() local
557 sdp->in_ep = ep_in; /* Store IN EP for enabling @ setup */ in sdp_bind()
558 sdp->out_ep = ep_out; in sdp_bind()
560 cdev->req->context = sdp; in sdp_bind()
619 struct f_sdp *sdp = func_to_sdp(f); in sdp_set_alt() local
627 result = usb_ep_enable(sdp->in_ep, &in_hs_desc); in sdp_set_alt()
628 result |= usb_ep_enable(sdp->out_ep, &out_hs_desc); in sdp_set_alt()
630 result = usb_ep_enable(sdp->in_ep, &in_desc); in sdp_set_alt()
631 result |= usb_ep_enable(sdp->out_ep, &out_desc); in sdp_set_alt()
636 sdp->in_req = sdp_start_ep(sdp->in_ep, true); in sdp_set_alt()
637 sdp->in_req->context = sdp; in sdp_set_alt()
638 sdp->out_req = sdp_start_ep(sdp->out_ep, false); in sdp_set_alt()
639 sdp->out_req->context = sdp; in sdp_set_alt()
641 sdp->in_ep->driver_data = cdev; /* claim */ in sdp_set_alt()
642 sdp->out_ep->driver_data = cdev; /* claim */ in sdp_set_alt()
644 sdp->altsetting = alt; in sdp_set_alt()
645 sdp->state = SDP_STATE_IDLE; in sdp_set_alt()
646 sdp->ep_int_enable = true; in sdp_set_alt()
653 struct f_sdp *sdp = func_to_sdp(f); in sdp_get_alt() local
655 return sdp->altsetting; in sdp_get_alt()
660 struct f_sdp *sdp = func_to_sdp(f); in sdp_disable() local
662 usb_ep_disable(sdp->in_ep); in sdp_disable()
663 usb_ep_disable(sdp->out_ep); in sdp_disable()
665 if (sdp->in_req) { in sdp_disable()
666 free(sdp->in_req->buf); in sdp_disable()
667 usb_ep_free_request(sdp->in_ep, sdp->in_req); in sdp_disable()
668 sdp->in_req = NULL; in sdp_disable()
670 if (sdp->out_req) { in sdp_disable()
671 free(sdp->out_req->buf); in sdp_disable()
672 usb_ep_free_request(sdp->out_ep, sdp->out_req); in sdp_disable()
673 sdp->out_req = NULL; in sdp_disable()