1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 249148020SSam Ravnborg /*********************************** 349148020SSam Ravnborg * $Id: quicc_simple.h,v 1.1 2002/03/02 15:01:10 gerg Exp $ 449148020SSam Ravnborg *********************************** 549148020SSam Ravnborg * 649148020SSam Ravnborg *************************************** 749148020SSam Ravnborg * Simple drivers common header 849148020SSam Ravnborg *************************************** 949148020SSam Ravnborg */ 1049148020SSam Ravnborg 1149148020SSam Ravnborg #ifndef __SIMPLE_H 1249148020SSam Ravnborg #define __SIMPLE_H 1349148020SSam Ravnborg 1449148020SSam Ravnborg /* #include "quicc.h" */ 1549148020SSam Ravnborg 1649148020SSam Ravnborg #define GLB_SCC_0 0 1749148020SSam Ravnborg #define GLB_SCC_1 1 1849148020SSam Ravnborg #define GLB_SCC_2 2 1949148020SSam Ravnborg #define GLB_SCC_3 3 2049148020SSam Ravnborg 2149148020SSam Ravnborg typedef void (int_routine)(unsigned short interrupt_event); 2249148020SSam Ravnborg typedef int_routine *int_routine_ptr; 2349148020SSam Ravnborg typedef void *(alloc_routine)(int length); 2449148020SSam Ravnborg typedef void (free_routine)(int scc_num, int channel_num, void *buf); 2549148020SSam Ravnborg typedef void (store_rx_buffer_routine)(int scc_num, int channel_num, void *buff, int length); 2649148020SSam Ravnborg typedef int (handle_tx_error_routine)(int scc_num, int channel_num, QUICC_BD *tbd); 2749148020SSam Ravnborg typedef void (handle_rx_error_routine)(int scc_num, int channel_num, QUICC_BD *rbd); 2849148020SSam Ravnborg typedef void (handle_lost_error_routine)(int scc_num, int channel_num); 2949148020SSam Ravnborg 3049148020SSam Ravnborg /* user defined functions for global errors */ 3149148020SSam Ravnborg typedef void (handle_glob_overrun_routine)(int scc_number); 3249148020SSam Ravnborg typedef void (handle_glob_underrun_routine)(int scc_number); 3349148020SSam Ravnborg typedef void (glob_intr_q_overflow_routine)(int scc_number); 3449148020SSam Ravnborg 3549148020SSam Ravnborg /* 3649148020SSam Ravnborg * General initialization and command routines 3749148020SSam Ravnborg */ 3849148020SSam Ravnborg void quicc_issue_cmd (unsigned short cmd, int scc_num); 3949148020SSam Ravnborg void quicc_init(void); 4049148020SSam Ravnborg void quicc_scc_init(int scc_number, int number_of_rx_buf, int number_of_tx_buf); 4149148020SSam Ravnborg void quicc_smc_init(int smc_number, int number_of_rx_buf, int number_of_tx_buf); 4249148020SSam Ravnborg void quicc_scc_start(int scc_num); 4349148020SSam Ravnborg void quicc_scc_loopback(int scc_num); 4449148020SSam Ravnborg 4549148020SSam Ravnborg /* Interrupt enable/disable routines for critical pieces of code*/ 4649148020SSam Ravnborg unsigned short IntrDis(void); 4749148020SSam Ravnborg void IntrEna(unsigned short old_sr); 4849148020SSam Ravnborg 4949148020SSam Ravnborg /* For debugging */ 5049148020SSam Ravnborg void print_rbd(int scc_num); 5149148020SSam Ravnborg void print_tbd(int scc_num); 5249148020SSam Ravnborg 5349148020SSam Ravnborg #endif 54