Ejemplo n.º 1
0
static void kbdev_ctl_set_ind(kbd_dev_t *kdev, unsigned mods)
{
	async_sess_t *sess = ((kbdev_t *) kdev->ctl_private)->sess;
	async_exch_t *exch = async_exchange_begin(sess);
	if (!exch)
		return;
	
	async_msg_1(exch, KBDEV_SET_IND, mods);
	async_exchange_end(exch);
}
Ejemplo n.º 2
0
static void chardev_port_write(uint8_t data)
{
	async_exch_t *exch = async_exchange_begin(dev_sess);
	if (exch == NULL) {
		printf("%s: Failed starting exchange with device\n", NAME);
		return;
	}

	async_msg_1(exch, CHAR_WRITE_BYTE, data);
	async_exchange_end(exch);
}
Ejemplo n.º 3
0
void hda_pcm_event(hda_t *hda, pcm_event_t event)
{
	async_exch_t *exchange;

	if (hda->ev_sess == NULL) {
		if (0) ddf_log_warning("No one listening for event %u", event);
		return;
	}

	exchange = async_exchange_begin(hda->ev_sess);
	async_msg_1(exchange, event, 0);
	async_exchange_end(exchange);
}
Ejemplo n.º 4
0
static void adb_packet_handle(uint8_t *data, size_t size, bool autopoll)
{
	uint8_t dev_addr;
	uint8_t reg_no;
	uint16_t reg_val;
	unsigned i;

	dev_addr = data[0] >> 4;
	reg_no = data[0] & 0x03;

	if (size != 3) {
		printf("unrecognized packet, size=%d\n", size);
		for (i = 0; i < size; ++i) {
			printf(" 0x%02x", data[i]);
		}
		putchar('\n');
		return;
	}

	if (reg_no != 0) {
		printf("unrecognized packet, size=%d\n", size);
		for (i = 0; i < size; ++i) {
			printf(" 0x%02x", data[i]);
		}
		putchar('\n');
		return;
	}

	reg_val = ((uint16_t) data[1] << 8) | (uint16_t) data[2];

	if (adb_dev[dev_addr].client_sess == NULL)
		return;

	async_exch_t *exch =
	    async_exchange_begin(adb_dev[dev_addr].client_sess);
	async_msg_1(exch, ADB_REG_NOTIF, reg_val);
	async_exchange_end(exch);
}
Ejemplo n.º 5
0
/**
 * Disable interrupts for this driver.
 *
 * @param nic_data
 * @param irq			The IRQ number for this device
 */
void nic_disable_interrupt(nic_t *nic_data, int irq)
{
	async_exch_t *exch = async_exchange_begin(nic_data->irc_session);
	async_msg_1(exch, IRC_CLEAR_INTERRUPT, irq);
	async_exchange_end(exch);
}