ixgbe_caller_dispatch.c 2.61 KB
Newer Older
1 2 3 4 5 6 7
#include <lcd_config/pre_hook.h>
#include <liblcd/liblcd.h>
#include "../ixgbe_caller.h"
#include <lcd_config/post_hook.h>

#define trace(x) LIBLCD_MSG("net got " #x " msg")

8 9
extern void ixgbe_exit_module(void);

10 11 12 13 14 15 16 17
int dispatch_async_loop(struct thc_channel *_channel,
		struct fipc_message *message,
		struct glue_cspace *cspace,
		struct cptr sync_ep)
{
	int fn_type;
	fn_type = async_msg_get_fn_type(message);
	switch (fn_type) {
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
		case NDO_OPEN:
			trace(NDO_OPEN);
			return ndo_open_callee(message,
		_channel,
		cspace,
		sync_ep);

		case NDO_STOP:
			trace(NDO_STOP);
			return ndo_stop_callee(message,
		_channel,
		cspace,
		sync_ep);

		case NDO_START_XMIT:
			trace(NDO_START_XMIT);
			return ndo_start_xmit_callee(message,
		_channel,
		cspace,
		sync_ep);

		case NDO_SET_RX_MODE:
			trace(NDO_SET_RX_MODE);
			return ndo_set_rx_mode_callee(message,
		_channel,
		cspace,
		sync_ep);

		case NDO_VALIDATE_ADDR:
			trace(NDO_VALIDATE_ADDR);
			return ndo_validate_addr_callee(message,
		_channel,
		cspace,
		sync_ep);

		case NDO_SET_MAC_ADDRESS:
			trace(NDO_SET_MAC_ADDRESS);
			return ndo_set_mac_address_callee(message,
		_channel,
		cspace,
		sync_ep);

		case NDO_CHANGE_MTU:
			trace(NDO_CHANGE_MTU);
			return ndo_change_mtu_callee(message,
		_channel,
		cspace,
		sync_ep);

		case NDO_TX_TIMEOUT:
			trace(NDO_TX_TIMEOUT);
			return ndo_tx_timeout_callee(message,
		_channel,
		cspace,
		sync_ep);

		case NDO_SET_TX_MAXRATE:
			trace(NDO_SET_TX_MAXRATE);
			return ndo_set_tx_maxrate_callee(message,
		_channel,
		cspace,
		sync_ep);

		case NDO_GET_STATS64:
			trace(NDO_GET_STATS64);
			return ndo_get_stats64_callee(message,
		_channel,
		cspace,
		sync_ep);

88 89 90 91 92 93 94
		case PROBE:
			trace(PROBE);
			return probe_callee(message,
		_channel,
		cspace,
		sync_ep);

95 96 97 98 99 100 101
		case REMOVE:
			trace(REMOVE);
			return remove_callee(message,
		_channel,
		cspace,
		sync_ep);

102 103 104 105 106 107 108 109 110 111 112 113 114 115
		case SYNC:
			trace(SYNC);
			return sync_callee(message,
		_channel,
		cspace,
		sync_ep);

		case UNSYNC:
			trace(UNSYNC);
			return unsync_callee(message,
		_channel,
		cspace,
		sync_ep);

Vikram Narayanan's avatar
Vikram Narayanan committed
116 117 118 119 120 121 122 123 124 125 126 127 128 129
		case SERVICE_EVENT_SCHED:
			trace(SERVICE_EVENT_SCHED);
			return ixgbe_service_event_schedule_callee(message,
		_channel,
		cspace,
		sync_ep);

		case TRIGGER_DUMP:
			trace(TRIGGER_DUMP);
			return trigger_dump_callee(message,
		_channel,
		cspace,
		sync_ep);

130 131 132 133 134 135 136 137
		case TRIGGER_EXIT:
			trace(TRIGGER_EXIT);
			ixgbe_exit_module();
			/* XXX: return failure to exit the dispatch
			 * loop. After exit, there is no reason to
			 * be spinning on the loop
			 */
			return -1;
138 139 140 141 142 143 144 145 146 147
		default:
			LIBLCD_ERR("unexpected function label: %d",
					fn_type);
			return -EINVAL;

	}
	return 0;

}