/* * Copyright (c) 2019 AVM GmbH . * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef _ATH_CARR_PLTFRM_H_ #define _ATH_CARR_PLTFRM_H_ #include #define CARRIER_PLTFRM_PRIVATE_SET __stringify(vlanID) #define CARRIER_PLTFRM_PRIVATE_GET __stringify(get_vlanID) #define PARTNER_COMPILE_TIME_ASSERT(assertion_name, predicate) \ typedef char assertion_name[(predicate) ? 1 : -1] #define PARTNER_ETHTOOL_SUPPORTED (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) #define LITE_PATH_HEADROOM 128 #define LITE_PATH_TAILROOM 192 #define LITE_PATH_LIMIT ( 2048 - ( LITE_PATH_HEADROOM + LITE_PATH_TAILROOM ) ) /*PPA buffer size is fixed to 2048. To accommodate RX descriptor + buffer, RX_BUF_SIZE(1728) isn't enough. So, we use 96 bytes from the PPA headroom. Effectively PPA headroom is decreased from 128 bytes to 32 bytes. */ #define RX_USE_ON_PP_HEADER 96 #define HTT_RX_BUF_SIZE_3PP ( LITE_PATH_LIMIT + RX_USE_ON_PP_HEADER ) #define HTT_LOG2_MAX_CACHE_LINE_SIZE_3PP 3 #define HTT_MAX_CACHE_LINE_SIZE_MASK_3PP ((1 << HTT_LOG2_MAX_CACHE_LINE_SIZE_3PP) - 1) PARTNER_COMPILE_TIME_ASSERT(htt_rx_buff_size_quantum1, (HTT_RX_BUF_SIZE_3PP & 0x3) == 0); PARTNER_COMPILE_TIME_ASSERT(htt_rx_buff_size_quantum2, (HTT_RX_BUF_SIZE_3PP & HTT_MAX_CACHE_LINE_SIZE_MASK_3PP) == 0); struct partner_com_param{ void *bdx_ppa_subif; }; struct partner_vap_param{ void *bdx_ppa_subif; }; struct ieee80211com; typedef struct ieee80211com *wlan_dev_t; struct ieee80211vap; typedef struct ieee80211vap *wlan_if_t; struct _os_if_t; typedef struct _os_if_t *os_if_t; static inline void osif_pltfrm_record_macinfor(unsigned char unit, unsigned char* mac) { } static inline int ospriv_pltfrm_vlan_skip(void) { return 0; } static inline uint8_t * bufcarr_pltfrm_nbufdata (struct sk_buff *skb) { return skb->data; } static inline int bufcarr_pltfrm_rxbufsize (void) { return HTT_RX_BUF_SIZE_3PP; } static inline int bufcarr_pltfrm_rxcachesize ( void ) { return HTT_LOG2_MAX_CACHE_LINE_SIZE_3PP; } static inline void wlan_pltfrm_attach(struct net_device *dev) { } static inline void wlan_pltfrm_detach(struct net_device *dev) { } static inline void osif_pltfrm_create_vap(void *osifp) { } static inline void osif_pltfrm_delete_vap(void *osifp) { } int wlan_pltfrm_set_param(wlan_if_t vaphandle, u_int32_t val); int wlan_pltfrm_get_param(wlan_if_t vaphandle); void osif_pltfrm_vlan_feature_set(struct net_device *dev); bool __must_check osif_pltfrm_deliver_data(os_if_t osif, struct sk_buff *skb); bool __must_check osif_pltfrm_deliver_data_extwds(struct net_device *dev, struct sk_buff *skb); void osif_pltfrm_vap_init(struct net_device *dev); void osif_pltfrm_vap_stop(wlan_if_t vap, struct net_device *dev); void osif_pltfrm_extwds_init(struct net_device *dev); void osif_pltfrm_extwds_stop(struct net_device *dev); void ath_pltfrm_init(struct net_device *dev); void ath_pltfrm_exit(struct net_device *dev); struct sk_buff* ath_pltfrm_nbufalloc ( struct net_device *dev, int32_t size, int32_t reserve, int32_t align ); void *bufcarr_pltfrm_rxdesc(struct sk_buff *msdu); void bufcarr_pltfrm_setpktlen(struct sk_buff *skb, uint32_t len); int bufcarr_pltfrm_rxsize(struct sk_buff *buf, int rx_desc_size); int bufcarr_pltfrm_nbufmap ( qdf_device_t osdev, struct sk_buff *rx_netbuf, qdf_dma_dir_t dir); void WAR_PLTFRM_PCI_WRITE32(char *addr, u32 offset, u32 value, unsigned int war1); #endif /* _ATH_CARR_1_H_ */