mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
cardem: Make card_emu_report_status() optionally use IRQ endpoint
This just introduces the capability to report on IRQ, but we don't actually use it yet. Change-Id: I83db4463b7010ba243a8adbda3ac9393975b4814
This commit is contained in:
@@ -56,7 +56,7 @@ int card_emu_set_atr(struct card_handle *ch, const uint8_t *atr, uint8_t len);
|
||||
|
||||
struct llist_head *card_emu_get_uart_tx_queue(struct card_handle *ch);
|
||||
void card_emu_have_new_uart_tx(struct card_handle *ch);
|
||||
void card_emu_report_status(struct card_handle *ch);
|
||||
void card_emu_report_status(struct card_handle *ch, bool report_on_irq);
|
||||
|
||||
#define ENABLE_TX 0x01
|
||||
#define ENABLE_RX 0x02
|
||||
|
||||
@@ -64,4 +64,4 @@
|
||||
#define SIMTRACE_CARDEM_USB_EP_USIM2_INT 3
|
||||
|
||||
/*! Maximum number of endpoints */
|
||||
#define BOARD_USB_NUMENDPOINTS 6
|
||||
#define BOARD_USB_NUMENDPOINTS 7 /* 0 (control) + 2 (interfaces) * 3 (endpoints) */
|
||||
|
||||
@@ -1051,13 +1051,16 @@ void card_emu_have_new_uart_tx(struct card_handle *ch)
|
||||
}
|
||||
}
|
||||
|
||||
void card_emu_report_status(struct card_handle *ch)
|
||||
void card_emu_report_status(struct card_handle *ch, bool report_on_irq)
|
||||
{
|
||||
struct msgb *msg;
|
||||
struct cardemu_usb_msg_status *sts;
|
||||
uint8_t ep = ch->in_ep;
|
||||
|
||||
msg = usb_buf_alloc_st(ch->in_ep, SIMTRACE_MSGC_CARDEM,
|
||||
SIMTRACE_MSGT_BD_CEMU_STATUS);
|
||||
if (report_on_irq)
|
||||
ep = ch->irq_ep;
|
||||
|
||||
msg = usb_buf_alloc_st(ep, SIMTRACE_MSGC_CARDEM, SIMTRACE_MSGT_BD_CEMU_STATUS);
|
||||
if (!msg)
|
||||
return;
|
||||
|
||||
|
||||
@@ -538,7 +538,7 @@ static void dispatch_usb_command_cardem(struct msgb *msg, struct cardem_inst *ci
|
||||
usb_buf_free(msg);
|
||||
break;
|
||||
case SIMTRACE_MSGT_BD_CEMU_STATUS:
|
||||
card_emu_report_status(ci->ch);
|
||||
card_emu_report_status(ci->ch, false);
|
||||
usb_buf_free(msg);
|
||||
break;
|
||||
case SIMTRACE_MSGT_BD_CEMU_STATS:
|
||||
|
||||
Reference in New Issue
Block a user