Lines Matching refs:sdp

239 	struct f_sdp *sdp = req->context;  in sdp_rx_command_complete()  local
262 sdp->always_send_status = false; in sdp_rx_command_complete()
263 sdp->error_status = 0x0; in sdp_rx_command_complete()
265 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_command_complete()
266 sdp->dnl_address = be32_to_cpu(cmd->addr); in sdp_rx_command_complete()
267 sdp->dnl_bytes_remaining = be32_to_cpu(cmd->cnt); in sdp_rx_command_complete()
268 sdp->next_state = SDP_STATE_TX_REGISTER; in sdp_rx_command_complete()
270 sdp->dnl_bytes_remaining, sdp->dnl_address); in sdp_rx_command_complete()
273 sdp->always_send_status = true; in sdp_rx_command_complete()
274 sdp->error_status = SDP_WRITE_FILE_COMPLETE; in sdp_rx_command_complete()
276 sdp->state = SDP_STATE_RX_FILE_DATA; in sdp_rx_command_complete()
277 sdp->dnl_address = be32_to_cpu(cmd->addr); in sdp_rx_command_complete()
278 sdp->dnl_bytes_remaining = be32_to_cpu(cmd->cnt); in sdp_rx_command_complete()
279 sdp->next_state = SDP_STATE_IDLE; in sdp_rx_command_complete()
282 sdp->dnl_bytes_remaining, sdp->dnl_address); in sdp_rx_command_complete()
286 sdp->always_send_status = true; in sdp_rx_command_complete()
287 sdp->error_status = 0; in sdp_rx_command_complete()
289 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_command_complete()
290 sdp->next_state = SDP_STATE_IDLE; in sdp_rx_command_complete()
293 sdp->always_send_status = true; in sdp_rx_command_complete()
294 sdp->error_status = SDP_WRITE_REGISTER_COMPLETE; in sdp_rx_command_complete()
296 sdp->state = SDP_STATE_RX_DCD_DATA; in sdp_rx_command_complete()
297 sdp->dnl_bytes_remaining = be32_to_cpu(cmd->cnt); in sdp_rx_command_complete()
298 sdp->next_state = SDP_STATE_IDLE; in sdp_rx_command_complete()
301 sdp->always_send_status = false; in sdp_rx_command_complete()
302 sdp->error_status = 0; in sdp_rx_command_complete()
304 sdp->jmp_address = be32_to_cpu(cmd->addr); in sdp_rx_command_complete()
305 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_command_complete()
306 sdp->next_state = SDP_STATE_JUMP; in sdp_rx_command_complete()
309 sdp->always_send_status = true; in sdp_rx_command_complete()
310 sdp->error_status = SDP_SKIP_DCD_HEADER_COMPLETE; in sdp_rx_command_complete()
313 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_command_complete()
314 sdp->next_state = SDP_STATE_IDLE; in sdp_rx_command_complete()
323 struct f_sdp *sdp = req->context; in sdp_rx_data_complete() local
339 if (sdp->dnl_bytes_remaining < datalen) { in sdp_rx_data_complete()
345 sdp->dnl_bytes_remaining = 0; in sdp_rx_data_complete()
347 sdp->dnl_bytes_remaining -= datalen; in sdp_rx_data_complete()
350 if (sdp->state == SDP_STATE_RX_FILE_DATA) { in sdp_rx_data_complete()
351 memcpy(sdp_ptr(sdp->dnl_address), req->buf + 1, datalen); in sdp_rx_data_complete()
352 sdp->dnl_address += datalen; in sdp_rx_data_complete()
355 if (sdp->dnl_bytes_remaining) in sdp_rx_data_complete()
360 switch (sdp->state) { in sdp_rx_data_complete()
362 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_data_complete()
365 sdp->state = SDP_STATE_TX_SEC_CONF; in sdp_rx_data_complete()
368 pr_err("Invalid state: %d\n", sdp->state); in sdp_rx_data_complete()
374 struct f_sdp *sdp = req->context; in sdp_tx_complete() local
382 switch (sdp->state) { in sdp_tx_complete()
385 if (sdp->always_send_status || sdp->error_status) in sdp_tx_complete()
386 sdp->state = SDP_STATE_TX_STATUS; in sdp_tx_complete()
388 sdp->state = sdp->next_state; in sdp_tx_complete()
392 sdp->state = sdp->next_state; in sdp_tx_complete()
395 if (sdp->dnl_bytes_remaining) in sdp_tx_complete()
396 sdp->state = SDP_STATE_TX_REGISTER; in sdp_tx_complete()
398 sdp->state = SDP_STATE_IDLE; in sdp_tx_complete()
401 pr_err("Wrong State: %d\n", sdp->state); in sdp_tx_complete()
402 sdp->state = SDP_STATE_IDLE; in sdp_tx_complete()
413 struct f_sdp *sdp = f->config->cdev->req->context; in sdp_setup() local
421 req_type, ctrl->bRequest, sdp->state); in sdp_setup()
428 sdp->configuration_done = true; in sdp_setup()
468 struct f_sdp *sdp = func_to_sdp(f); in sdp_bind() local
485 sdp->in_ep = ep; /* Store IN EP for enabling @ setup */ in sdp_bind()
487 cdev->req->context = sdp; in sdp_bind()
535 struct f_sdp *sdp = func_to_sdp(f); in sdp_set_alt() local
541 result = usb_ep_enable(sdp->in_ep, &in_desc); in sdp_set_alt()
544 sdp->in_req = sdp_start_ep(sdp->in_ep); in sdp_set_alt()
545 sdp->in_req->context = sdp; in sdp_set_alt()
547 sdp->in_ep->driver_data = cdev; /* claim */ in sdp_set_alt()
549 sdp->altsetting = alt; in sdp_set_alt()
550 sdp->state = SDP_STATE_IDLE; in sdp_set_alt()
557 struct f_sdp *sdp = func_to_sdp(f); in sdp_get_alt() local
559 return sdp->altsetting; in sdp_get_alt()
564 struct f_sdp *sdp = func_to_sdp(f); in sdp_disable() local
566 usb_ep_disable(sdp->in_ep); in sdp_disable()
568 if (sdp->in_req) { in sdp_disable()
569 free(sdp->in_req); in sdp_disable()
570 sdp->in_req = NULL; in sdp_disable()