/* * GigaSpaceWire switch driver for MC-30SF6EM-6U evaluation kit * * Copyright (c) 2019 Elvees (support@elvees.com) * Author: Dmitry Evtushenko * */ #ifndef __ethospw_h #define __ethospw_h #define ETHOSPW_DEV_NAME "ethospw" typedef struct ethospw_s ethospw_t; extern int drv_ethospw_init( void); extern void drv_ethospw_exit( void); #if 0 struct mc_spw { int num; char name[ sizeof(ETHOSPW_DEV_NAME) + 1]; struct net_device * pdev; /* struct sk_buff * pending_tx_skb; struct sk_buff * recent_tx_skb; //int no_restart; spw_descriptor_t tx_desc __attribute__ ((aligned (8))); char * tx_data_buffer; spw_descriptor_t * rx_desc_buffer; char * rx_data_buffer; spw_descriptor_t * cur_rx_desc; char * cur_rx_data; dma_params_t rx_desc_chain [RX_DESC_BUFSZ / sizeof (spw_descriptor_t)] __attribute__ ((aligned (8))); dma_params_t rx_data_chain __attribute__ ((aligned (8))); struct timer_list start_timer; unsigned speed; int just_connected; char txbuf [ETH_MTU + ETH_HEADER_SIZE + ETH_CRC_SIZE] __attribute__ ((aligned (8))); char rxbuf [RX_DATA_BUFSZ] __attribute__ ((aligned (8))); char rxdescbuf [RX_DESC_BUFSZ] __attribute__ ((aligned (8))); */ }; #endif //0 // sk_buff data: typedef struct skb_dat_s { struct sk_buff *pskb; unsigned char *pdata; u32 sz_data; u32 pos_data; } skb_dat_t; extern void skbd_clear( skb_dat_t *pskbd); extern int skbd_add_data( skb_dat_t *pskbd, ethospw_t *peos, u32 sz_data, char *pd, u32 len_d); extern int skbd_send( skb_dat_t *pskbd, ethospw_t *peos); static inline int skbd_is_ready( skb_dat_t *pskbd) { return ((pskbd->pos_data == pskbd->sz_data) ? 1 : 0); } // private part of network device data: struct ethospw_s { unsigned num; //char name[ sizeof(ETHOSPW_CARD_NAME) + 1]; struct net_device *pdev; int is_open; //- 0, 1 int exit_rx_job; //- 0, 1, 2 struct task_struct *p_task_rx_job; //struct mutex mtx_rx; skb_dat_t skb; u32 cnt_tx_pack; u32 cnt_rx_pack; }; extern void ethospw_init( ethospw_t *peos); extern int is_init_ethospw; #endif //!__ethospw_h