예제 #1
0
int mv_eth_tool_write (struct file *file, const char *buffer,
                      unsigned long count, void *data) {

	sscanf(buffer,"%x",&command);

	switch (command) {
		case COM_RX_COAL:
		case COM_TX_COAL:
        case COM_TX_EN:
        case COM_EJP_MODE:
		case COM_TX_NOQUEUE:
			run_port_com(buffer);
			break;
		case COM_TXDONE_Q:
        case COM_SKB_REUSE:
			run_eth_com(buffer);
			break;

		case COM_TOS_MAP:
            run_port_queue_cmd(buffer);
			break;

#ifdef CONFIG_MV_ETH_NFP
		case COM_IP_RULE_SET:
			run_ip_rule_set_com(buffer);
			break;
		case COM_IP_RULE_DEL:
			run_ip_rule_del_com(buffer);
			break;
		case COM_FP_DISABLE:
			fp_mgr_disable();
			break;
		case COM_FP_ENABLE:
			fp_mgr_enable();
			break;
		case COM_FP_STATUS:
			fp_mgr_status();
			break;
		case COM_FP_PRINT:
			run_fp_db_print_com(buffer);
			break;
#endif /* CONFIG_MV_ETH_NFP */
#ifdef CONFIG_PM
		/* liron, for debug only */
		case COM_SUSPEND:
			state.event = 0;
			mv_eth_suspend(NULL, state);
			break;
		case COM_RESUME:
			mv_eth_resume(NULL);
			break;
#endif /* CONFIG_PM */
		default:
			run_com_general(buffer);
			break;
	}
	return count;
}
예제 #2
0
int mv_eth_tool_write (struct file *file, const char *buffer,
                      unsigned long count, void *data) {

	sscanf(buffer,"%x",&command);

	switch (command) {
		case COM_RX_COAL:
		case COM_TX_COAL:
        case COM_TX_EN:
        case COM_EJP_MODE:
		case COM_TX_NOQUEUE:
		case COM_LRO:
		case COM_LRO_DESC:
			run_port_com(buffer);
			break;
		case COM_TXDONE_Q:
        case COM_SKB_REUSE:
        case COM_SKB_RECYCLE:
		case COM_NFP:
			run_eth_com(buffer);
			break;
		case COM_TOS_MAP:
            run_port_queue_cmd(buffer);
			break;
		case COM_NETDEV_STS:
		case COM_NETDEV_PORT_ADD:
		case COM_NETDEV_PORT_DEL:
			run_netdev_cmd(buffer);
			break;
		case COM_NETDEV_VTU_ADD:
		case COM_NETDEV_VTU_DEL:
			run_netdev_vtu_cmd(buffer);
			break;
#ifdef CONFIG_MV_ETH_NFP
		case COM_IP_RULE_SET:
			run_ip_rule_set_com(buffer);
			break;
		case COM_IP_RULE_DEL:
			run_ip_rule_del_com(buffer);
			break;
		case COM_NFP_STATUS:
			fp_mgr_status();
			break;
		case COM_NFP_PRINT:
			run_fp_db_print_com(buffer);
			break;
#endif /* CONFIG_MV_ETH_NFP */

		default:
			run_com_general(buffer);
			break;
	}
	return count;
}