qcacmn: Add new QDF API's to handle napi requirements

Add new QDF API's to handle napi, softirq related handling
in rx thread and rx refill thread.

Change-Id: I0f371c89e65d8b20f059c56097bac07ec1e19cc9
CRs-Fixed: 3341804
This commit is contained in:
Roopavathi Lingampalli
2022-10-25 11:42:46 +05:30
committed by Madan Koyyalamudi
parent b17c45a9d8
commit edc0d60122
12 changed files with 347 additions and 82 deletions

View File

@@ -28,7 +28,7 @@
#include <qdf_types.h> #include <qdf_types.h>
#include <i_qdf_defer.h> #include <i_qdf_defer.h>
/** /*
* TODO This implements work queues (worker threads, kernel threads etc.). * TODO This implements work queues (worker threads, kernel threads etc.).
* Note that there is no cancel on a scheduled work. You cannot free a work * Note that there is no cancel on a scheduled work. You cannot free a work
* item if its queued. You cannot know if a work item is queued or not unless * item if its queued. You cannot know if a work item is queued or not unless
@@ -62,7 +62,7 @@ void
qdf_create_bh(qdf_bh_t *bh, qdf_defer_fn_t func, void *arg); qdf_create_bh(qdf_bh_t *bh, qdf_defer_fn_t func, void *arg);
/** /**
* qdf_sched - schedule a bottom half (DPC) * qdf_sched_bh - schedule a bottom half (DPC)
* @bh: pointer to bottom * @bh: pointer to bottom
* Return: none * Return: none
*/ */
@@ -198,6 +198,23 @@ void qdf_flush_workqueue(qdf_handle_t hdl, qdf_workqueue_t *wqueue);
* Return: none * Return: none
*/ */
void qdf_destroy_work(qdf_handle_t hdl, qdf_work_t *work); void qdf_destroy_work(qdf_handle_t hdl, qdf_work_t *work);
/**
* qdf_local_bh_disable - Disables softirq and tasklet processing
* on the local processor
*
* Return: none
*/
void qdf_local_bh_disable(void);
/**
* qdf_local_bh_enable - Disables softirq and tasklet processing
* on the local processor
*
* Return: none
*/
void qdf_local_bh_enable(void);
#else #else
/** /**
* qdf_create_bh - creates the bottom half deferred handler * qdf_create_bh - creates the bottom half deferred handler
@@ -213,7 +230,7 @@ qdf_create_bh(qdf_bh_t *bh, qdf_defer_fn_t func, void *arg)
} }
/** /**
* qdf_sched - schedule a bottom half (DPC) * qdf_sched_bh - schedule a bottom half (DPC)
* @bh: pointer to bottom * @bh: pointer to bottom
* Return: none * Return: none
*/ */
@@ -232,6 +249,28 @@ static inline void qdf_destroy_bh(qdf_bh_t *bh)
__qdf_disable_bh(bh); __qdf_disable_bh(bh);
} }
/**
* qdf_local_bh_disable - Disables softirq and tasklet processing
* on the local processor
*
* Return: none
*/
static inline void qdf_local_bh_disable(void)
{
__qdf_local_bh_disable();
}
/**
* qdf_local_bh_enable - Enables softirq and tasklet processing
* on the local processor
*
* Return: none
*/
static inline void qdf_local_bh_enable(void)
{
__qdf_local_bh_enable();
}
/*********************Non-Interrupt Context deferred Execution***************/ /*********************Non-Interrupt Context deferred Execution***************/
/** /**

View File

@@ -65,6 +65,36 @@ qdf_net_if_get_dev_by_name(char *nif_name);
QDF_STATUS QDF_STATUS
qdf_net_if_release_dev(struct qdf_net_if *nif); qdf_net_if_release_dev(struct qdf_net_if *nif);
/**
* qdf_napi_enable() - Enable the napi schedule
* @napi: NAPI context
*
* This function resume NAPI from being scheduled on this context
*
* Return: NONE
*/
void qdf_napi_enable(struct napi_struct *napi);
/**
* qdf_netif_napi_add - initialize a NAPI context
* @netdev: network device
* @napi: NAPI context
* @poll: polling function
* @weight: default weight
*
* Return: NONE
*/
void qdf_netif_napi_add(struct net_device *netdev, struct napi_struct *napi,
int (*poll)(struct napi_struct *, int), int weight);
/**
* qdf_netif_napi_del - remove a NAPI context
* @napi: NAPI context
*
* Return: NONE
*/
void qdf_netif_napi_del(struct napi_struct *napi);
/** /**
* qdf_net_update_net_device_dev_addr() - update net_device dev_addr * qdf_net_update_net_device_dev_addr() - update net_device dev_addr
* @ndev: net_device * @ndev: net_device
@@ -115,6 +145,25 @@ qdf_net_update_net_device_dev_addr(struct net_device *ndev,
{ {
__qdf_net_update_net_device_dev_addr(ndev, src_addr, len); __qdf_net_update_net_device_dev_addr(ndev, src_addr, len);
} }
static inline void
qdf_napi_enable(struct napi_struct *napi)
{
__qdf_napi_enable(napi);
}
static inline void
qdf_netif_napi_add(struct net_device *netdev, struct napi_struct *napi,
int (*poll)(struct napi_struct *, int), int weight)
{
__qdf_netif_napi_add(netdev, napi, poll, weight);
}
static inline void
qdf_netif_napi_del(struct napi_struct *napi)
{
__qdf_netif_napi_del(napi);
}
#endif /* ENHANCED_OS_ABSTRACTION */ #endif /* ENHANCED_OS_ABSTRACTION */
/** /**

View File

@@ -81,6 +81,7 @@
* @QDF_STATUS_QMI_TXN_INIT_FAILED: QMI transaction init failed * @QDF_STATUS_QMI_TXN_INIT_FAILED: QMI transaction init failed
* @QDF_STATUS_QMI_SEND_REQ_FAILED: QMI send request failed * @QDF_STATUS_QMI_SEND_REQ_FAILED: QMI send request failed
* @QDF_STATUS_QMI_TXN_WAIT_FAILED: QMI transaction wait failed * @QDF_STATUS_QMI_TXN_WAIT_FAILED: QMI transaction wait failed
* @QDF_STATUS_E_RESTART: return error code for wait_event_interruptible
* @QDF_STATUS_MAX: not a real value just a place holder for max * @QDF_STATUS_MAX: not a real value just a place holder for max
*/ */
typedef enum { typedef enum {
@@ -138,6 +139,7 @@ typedef enum {
QDF_STATUS_QMI_TXN_INIT_FAILED, QDF_STATUS_QMI_TXN_INIT_FAILED,
QDF_STATUS_QMI_SEND_REQ_FAILED, QDF_STATUS_QMI_SEND_REQ_FAILED,
QDF_STATUS_QMI_TXN_WAIT_FAILED, QDF_STATUS_QMI_TXN_WAIT_FAILED,
QDF_STATUS_E_RESTART,
QDF_STATUS_MAX QDF_STATUS_MAX
} QDF_STATUS; } QDF_STATUS;

View File

@@ -58,8 +58,9 @@ void qdf_set_user_nice(qdf_thread_t *thread, long nice);
/** /**
* qdf_create_thread() - create a kernel thread * qdf_create_thread() - create a kernel thread
* @thread: pointer to thread * @thread_handler: pointer to thread handler
* @nice: nice value * @data: data
* @thread_name: thread name
* *
* Return: pointer to created kernel thread on success else NULL * Return: pointer to created kernel thread on success else NULL
*/ */
@@ -70,8 +71,9 @@ qdf_thread_t *qdf_create_thread(int (*thread_handler)(void *data), void *data,
* qdf_thread_run() - run the given function in a new thread * qdf_thread_run() - run the given function in a new thread
* *
* You must call qdf_thread_join() to avoid a reasource leak! * You must call qdf_thread_join() to avoid a reasource leak!
*
* For more flexibility, use qdf_create_thread() instead. * For more flexibility, use qdf_create_thread() instead.
* @callback: callback function
* @context: context
* *
* Return: a new qdf_thread pointer * Return: a new qdf_thread pointer
*/ */
@@ -79,6 +81,7 @@ qdf_thread_t *qdf_thread_run(qdf_thread_func callback, void *context);
/** /**
* qdf_thread_join() - signal and wait for a thread to stop * qdf_thread_join() - signal and wait for a thread to stop
* @thread: pointer to thread
* *
* This sets a flag that the given thread can check to see if it should exit. * This sets a flag that the given thread can check to see if it should exit.
* The thread can check to see if this flag has been set by calling * The thread can check to see if this flag has been set by calling
@@ -107,7 +110,7 @@ bool qdf_thread_should_stop(void);
int qdf_wake_up_process(qdf_thread_t *thread); int qdf_wake_up_process(qdf_thread_t *thread);
/** /**
* qdf_print_stack_trace_thread() - prints the stack trace of the given thread * qdf_print_thread_trace() - prints the stack trace of the given thread
* @thread: the thread for which the stack trace will be printed * @thread: the thread for which the stack trace will be printed
* *
* Return: None * Return: None
@@ -209,4 +212,20 @@ void qdf_cpumask_copy(qdf_cpu_mask *dstp,
*/ */
void qdf_cpumask_or(qdf_cpu_mask *dstp, qdf_cpu_mask *src1p, void qdf_cpumask_or(qdf_cpu_mask *dstp, qdf_cpu_mask *src1p,
qdf_cpu_mask *src2p); qdf_cpu_mask *src2p);
/**
* qdf_thread_cpumap_print_to_pagebuf - copies the cpumask into the buffer
* either as comma-separated list of cpus or hex values of cpumask
* @list: indicates whether the cpumap is list or not
* @new_mask: the cpumask to copy
* @new_mask_str: the buffer to copy into
*
* This functions copies the cpu mask set for the thread by
* qdf_thread_set_cpus_allowed_mask() to new_mask_str
*
* Return: None
*/
void
qdf_thread_cpumap_print_to_pagebuf(bool list, char *new_mask_str,
qdf_cpu_mask *new_mask);
#endif /* __QDF_THREADS_H */ #endif /* __QDF_THREADS_H */

View File

@@ -43,7 +43,7 @@
/** /**
* struct qdf_sglist - scatter-gather list * struct qdf_sglist - scatter-gather list
* @nsegs: total number of segments * @nsegs: total number of segments
* struct __sg_segs - scatter-gather segment list * @struct sg_segs - scatter-gather segment list
* @vaddr: Virtual address of the segment * @vaddr: Virtual address of the segment
* @len: Length of the segment * @len: Length of the segment
*/ */
@@ -101,7 +101,6 @@ typedef void *qdf_drv_handle_t;
typedef void *qdf_os_handle_t; typedef void *qdf_os_handle_t;
typedef void *qdf_pm_t; typedef void *qdf_pm_t;
/** /**
* typedef qdf_handle_t - handles opaque to each other * typedef qdf_handle_t - handles opaque to each other
*/ */
@@ -116,6 +115,7 @@ typedef uint16_t qdf_freq_t;
#else #else
typedef uint32_t qdf_freq_t; typedef uint32_t qdf_freq_t;
#endif #endif
/** /**
* typedef qdf_device_t - Platform/bus generic handle. * typedef qdf_device_t - Platform/bus generic handle.
* Used for bus specific functions. * Used for bus specific functions.
@@ -136,9 +136,9 @@ typedef __qdf_be64_t qdf_be64_t;
typedef __qdf_size_t qdf_size_t; typedef __qdf_size_t qdf_size_t;
/** /**
* typedef __qdf_off_t - offset for API's that need them. * typedef qdf_off_t - offset for API's that need them.
*/ */
typedef __qdf_off_t qdf_off_t; typedef __qdf_off_t qdf_off_t;
/** /**
* typedef qdf_dma_map_t - DMA mapping object. * typedef qdf_dma_map_t - DMA mapping object.
@@ -151,9 +151,9 @@ typedef __qdf_dma_map_t qdf_dma_map_t;
typedef __qdf_dma_addr_t qdf_dma_addr_t; typedef __qdf_dma_addr_t qdf_dma_addr_t;
/** /**
* typedef __qdf_dma_size_t - DMA size. * typedef qdf_dma_size_t - DMA size.
*/ */
typedef __qdf_dma_size_t qdf_dma_size_t; typedef __qdf_dma_size_t qdf_dma_size_t;
/** /**
* tyepdef qdf_dma_context_t - DMA context. * tyepdef qdf_dma_context_t - DMA context.
@@ -168,25 +168,30 @@ typedef __sgtable_t sgtable_t;
*/ */
typedef __qdf_cpu_mask qdf_cpu_mask; typedef __qdf_cpu_mask qdf_cpu_mask;
/** /*
* pointer to net device * pointer to net device
*/ */
typedef __qdf_netdev_t qdf_netdev_t; typedef __qdf_netdev_t qdf_netdev_t;
/** /*
* pointer to napi struct * pointer to napi struct
*/ */
typedef __qdf_napi_struct qdf_napi_struct; typedef __qdf_napi_struct qdf_napi_struct;
/** /*
* pointer to net dev stats * pointer to net dev stats
*/ */
typedef __qdf_net_dev_stats qdf_net_dev_stats; typedef __qdf_net_dev_stats qdf_net_dev_stats;
/*
* pointer to dummy net device
*/
typedef __qdf_dummy_netdev_t qdf_dummy_netdev_t;
/** /**
* struct qdf_dma_map_info - Information inside a DMA map. * struct qdf_dma_map_info - Information inside a DMA map.
* @nsegs: total number mapped segments * @nsegs: total number mapped segments
* struct __dma_segs - Information of physical address. * @struct dma_segs - list of segments
* @paddr: physical(dam'able) address of the segment * @paddr: physical(dam'able) address of the segment
* @len: length of the segment * @len: length of the segment
*/ */
@@ -203,7 +208,7 @@ typedef struct qdf_dma_map_info {
* @mem_info: memory info struct * @mem_info: memory info struct
* @vaddr: virtual address * @vaddr: virtual address
* @sgtable: scatter-gather table * @sgtable: scatter-gather table
* @memctx: dma address * @qdf_dma_mem_context: dma address
*/ */
typedef struct qdf_shared_mem { typedef struct qdf_shared_mem {
qdf_mem_info_t mem_info; qdf_mem_info_t mem_info;
@@ -230,7 +235,7 @@ typedef enum {
} QDF_TIMER_TYPE; } QDF_TIMER_TYPE;
/** /**
* tyepdef qdf_resource_type_t - hw resources * tyepdef enum qdf_resource_type_t - hw resources
* @QDF_RESOURCE_TYPE_MEM: memory resource * @QDF_RESOURCE_TYPE_MEM: memory resource
* @QDF_RESOURCE_TYPE_IO: io resource * @QDF_RESOURCE_TYPE_IO: io resource
* Define the hw resources the OS has allocated for the device * Define the hw resources the OS has allocated for the device
@@ -242,7 +247,7 @@ typedef enum {
} qdf_resource_type_t; } qdf_resource_type_t;
/** /**
* tyepdef qdf_resource_t - representation of a h/w resource. * tyepdef struct qdf_resource_t - representation of a h/w resource.
* @start: start * @start: start
* @end: end * @end: end
* @type: resource type * @type: resource type
@@ -713,7 +718,7 @@ const char *qdf_opmode_str(const enum QDF_OPMODE opmode);
* @QDF_GLOBAL_MONITOR_MODE: Monitor Mode * @QDF_GLOBAL_MONITOR_MODE: Monitor Mode
* @QDF_GLOBAL_FTM_MODE: FTM mode * @QDF_GLOBAL_FTM_MODE: FTM mode
* @QDF_GLOBAL_IBSS_MODE: IBSS mode * @QDF_GLOBAL_IBSS_MODE: IBSS mode
* @QDF_GLOBAL_COLDBOOT_CALIB_MODEL: Cold Boot Calibration Mode * @QDF_GLOBAL_COLDBOOT_CALIB_MODE: Cold Boot Calibration Mode
* @QDF_GLOBAL_EPPING_MODE: EPPING mode * @QDF_GLOBAL_EPPING_MODE: EPPING mode
* @QDF_GLOBAL_QVIT_MODE: QVIT global mode * @QDF_GLOBAL_QVIT_MODE: QVIT global mode
* @QDF_GLOBAL_FTM_COLDBOOT_CALIB_MODE: Cold Boot Calibration in FTM Mode * @QDF_GLOBAL_FTM_COLDBOOT_CALIB_MODE: Cold Boot Calibration in FTM Mode
@@ -975,41 +980,43 @@ struct qdf_mac_addr {
/** /**
* enum qdf_proto_subtype - subtype of packet * enum qdf_proto_subtype - subtype of packet
* @QDF_PROTO_EAPOL_M1 - EAPOL 1/4 * @QDF_PROTO_INVALID: invalid
* @QDF_PROTO_EAPOL_M2 - EAPOL 2/4 * @QDF_PROTO_EAPOL_M1: EAPOL 1/4
* @QDF_PROTO_EAPOL_M3 - EAPOL 3/4 * @QDF_PROTO_EAPOL_M2: EAPOL 2/4
* @QDF_PROTO_EAPOL_M4 - EAPOL 4/4 * @QDF_PROTO_EAPOL_M3: EAPOL 3/4
* @QDF_PROTO_DHCP_DISCOVER - discover * @QDF_PROTO_EAPOL_M4: EAPOL 4/4
* @QDF_PROTO_DHCP_REQUEST - request * @QDF_PROTO_DHCP_DISCOVER: discover
* @QDF_PROTO_DHCP_OFFER - offer * @QDF_PROTO_DHCP_REQUEST: request
* @QDF_PROTO_DHCP_ACK - ACK * @QDF_PROTO_DHCP_OFFER: offer
* @QDF_PROTO_DHCP_NACK - NACK * @QDF_PROTO_DHCP_ACK: ACK
* @QDF_PROTO_DHCP_RELEASE - release * @QDF_PROTO_DHCP_NACK: NACK
* @QDF_PROTO_DHCP_INFORM - inform * @QDF_PROTO_DHCP_RELEASE: release
* @QDF_PROTO_DHCP_DECLINE - decline * @QDF_PROTO_DHCP_INFORM: inform
* @QDF_PROTO_ARP_REQ - arp request * @QDF_PROTO_DHCP_DECLINE: decline
* @QDF_PROTO_ARP_RES - arp response * @QDF_PROTO_ARP_REQ: arp request
* @QDF_PROTO_ICMP_REQ - icmp request * @QDF_PROTO_ARP_RES: arp response
* @QDF_PROTO_ICMP_RES - icmp response * @QDF_PROTO_ICMP_REQ: icmp request
* @QDF_PROTO_ICMPV6_REQ - icmpv6 request * @QDF_PROTO_ICMP_RES: icmp response
* @QDF_PROTO_ICMPV6_RES - icmpv6 response * @QDF_PROTO_ICMPV6_REQ: icmpv6 request
* @QDF_PROTO_ICMPV6_RS - icmpv6 rs packet * @QDF_PROTO_ICMPV6_RES: icmpv6 response
* @QDF_PROTO_ICMPV6_RA - icmpv6 ra packet * @QDF_PROTO_ICMPV6_RS: icmpv6 rs packet
* @QDF_PROTO_ICMPV6_NS - icmpv6 ns packet * @QDF_PROTO_ICMPV6_RA: icmpv6 ra packet
* @QDF_PROTO_ICMPV6_NA - icmpv6 na packet * @QDF_PROTO_ICMPV6_NS: icmpv6 ns packet
* @QDF_PROTO_IPV4_UDP - ipv4 udp * @QDF_PROTO_ICMPV6_NA: icmpv6 na packet
* @QDF_PROTO_IPV4_TCP - ipv4 tcp * @QDF_PROTO_IPV4_UDP: ipv4 udp
* @QDF_PROTO_IPV6_UDP - ipv6 udp * @QDF_PROTO_IPV4_TCP: ipv4 tcp
* @QDF_PROTO_IPV6_TCP - ipv6 tcp * @QDF_PROTO_IPV6_UDP: ipv6 udp
* @QDF_PROTO_MGMT_ASSOC -assoc * @QDF_PROTO_IPV6_TCP: ipv6 tcp
* @QDF_PROTO_MGMT_DISASSOC - disassoc * @QDF_PROTO_MGMT_ASSOC: assoc
* @QDF_PROTO_MGMT_AUTH - auth * @QDF_PROTO_MGMT_DISASSOC: disassoc
* @QDF_PROTO_MGMT_DEAUTH - deauth * @QDF_PROTO_MGMT_AUTH: auth
* @QDF_ROAM_SYNCH - roam synch indication from fw * @QDF_PROTO_MGMT_DEAUTH: deauth
* @QDF_ROAM_COMPLETE - roam complete cmd to fw * @QDF_ROAM_SYNCH: roam synch indication from fw
* @QDF_ROAM_EVENTID - roam eventid from fw * @QDF_ROAM_COMPLETE: roam complete cmd to fw
* @QDF_PROTO_DNS_QUERY - dns query * @QDF_ROAM_EVENTID: roam eventid from fw
* @QDF_PROTO_DNS_RES -dns response * @QDF_PROTO_DNS_QUERY: dns query
* @QDF_PROTO_DNS_RES: dns response
* @QDF_PROTO_SUBTYPE_MAX: subtype max
*/ */
enum qdf_proto_subtype { enum qdf_proto_subtype {
QDF_PROTO_INVALID, QDF_PROTO_INVALID,
@@ -1217,8 +1224,7 @@ QDF_STATUS qdf_uint8_array_parse(const char *in_str, uint8_t *out_array,
/** /**
* struct qdf_tso_frag_t - fragments of a single TCP segment * struct qdf_tso_frag_t - fragments of a single TCP segment
* @paddr_low_32: Lower 32 bits of the buffer pointer * @paddr: physical address
* @paddr_upper_16: upper 16 bits of the buffer pointer
* @length: length of the buffer * @length: length of the buffer
* @vaddr: virtual address * @vaddr: virtual address
* *
@@ -1237,6 +1243,30 @@ struct qdf_tso_frag_t {
/** /**
* struct qdf_tso_flags_t - TSO specific flags * struct qdf_tso_flags_t - TSO specific flags
* @tso_enable: Enable transmit segmentation offload * @tso_enable: Enable transmit segmentation offload
* @reserved_0a: rsvd
* @fin: input bit
* @syn: syn
* @rst: reset
* @psh: push
* @ack: aknowledge
* @urg: urg
* @ece: ece
* @cwr: cwr
* @ns: ns
* @reserved_0b: rsvd
* @ipv4_checksum_en: Enable/Disable ipv4 checksum
* @udp_ipv4_checksum_en: Enable/Disable udp ipv4 checksum
* @udp_ipv6_checksum_en: Enable/Disable udp ipv6 checksum
* @tcp_ipv4_checksum_en: Enable/Disable tcp ipv4 checksum
* @tcp_ipv6_checksum_en: Enable/Disable tcp ipv6 checksum
* @partial_checksum_en: Enable/Disable partial checksum
* @reserved_3a: rsvd
* @checksum_offset: checksum offset
* @reserved_4a: rsvd
* @payload_start_offset: payload start offset
* @reserved_4b: rsvd
* @payload_end_offset: payload end offset
* @reserved_5: rsvd
* @tcp_flags_mask: Tcp_flag is inserted into the header based * @tcp_flags_mask: Tcp_flag is inserted into the header based
* on the mask * on the mask
* @l2_len: L2 length for the msdu * @l2_len: L2 length for the msdu
@@ -1303,10 +1333,25 @@ struct qdf_tso_seg_t {
}; };
/** /**
* TSO seg elem action caller locations: goes into dbg.history below. * enum tsoseg_dbg_caller_e: TSO seg elem action caller locations
* goes into dbg.history below.
* Needed to be defined outside of the feature so that * Needed to be defined outside of the feature so that
* callers can be coded without ifdefs (even if they get * callers can be coded without ifdefs (even if they get
* resolved to nothing) * resolved to nothing)
* @TSOSEG_LOC_UNDEFINED: undefined
* @TSOSEG_LOC_INIT1: init1
* @TSOSEG_LOC_INIT2: inti2
* @TSOSEG_LOC_FREE: free
* @TSOSEG_LOC_ALLOC: alloc
* @TSOSEG_LOC_DEINIT: deinit
* @TSOSEG_LOC_GETINFO: get info
* @TSOSEG_LOC_FILLHTTSEG: fill HTT segment
* @TSOSEG_LOC_FILLCMNSEG: fill CMN segment
* TSOSEG_LOC_PREPARETSO: prepare TSO
* @TSOSEG_LOC_TXPREPLLFAST: tx prep LL fast
* @TSOSEG_LOC_UNMAPTSO: unmap TSO
* @TSOSEG_LOC_UNMAPLAST: unmap last
* @TSOSEG_LOC_FORCE_FREE: force free
*/ */
enum tsoseg_dbg_caller_e { enum tsoseg_dbg_caller_e {
TSOSEG_LOC_UNDEFINED, TSOSEG_LOC_UNDEFINED,
@@ -1324,9 +1369,9 @@ enum tsoseg_dbg_caller_e {
TSOSEG_LOC_UNMAPLAST, TSOSEG_LOC_UNMAPLAST,
TSOSEG_LOC_FORCE_FREE, TSOSEG_LOC_FORCE_FREE,
}; };
#ifdef TSOSEG_DEBUG
/** #ifdef TSOSEG_DEBUG
/*
* WARNING: Don't change the history size without changing the wrap * WARNING: Don't change the history size without changing the wrap
* code in qdf_tso_seg_dbg_record function * code in qdf_tso_seg_dbg_record function
*/ */
@@ -1343,7 +1388,7 @@ struct qdf_tso_seg_dbg_t {
#endif /* TSOSEG_DEBUG */ #endif /* TSOSEG_DEBUG */
/** /**
* qdf_tso_seg_elem_t - tso segment element * struct qdf_tso_seg_elem_t - tso segment element
* @next: pointer to the next segment * @next: pointer to the next segment
* @seg: instance of segment * @seg: instance of segment
*/ */
@@ -1371,7 +1416,7 @@ struct qdf_tso_num_seg_t {
}; };
/** /**
* qdf_tso_num_seg_elem_t - num of tso segment element for jumbo skb * struct qdf_tso_num_seg_elem_t - num of tso segment element for jumbo skb
* @next: pointer to the next segment * @next: pointer to the next segment
* @num_seg: instance of num of seg * @num_seg: instance of num of seg
*/ */
@@ -1402,7 +1447,7 @@ struct qdf_tso_info_t {
uint32_t msdu_stats_idx; uint32_t msdu_stats_idx;
}; };
/** /*
* Used to set classify bit in CE desc. * Used to set classify bit in CE desc.
*/ */
#define QDF_CE_TX_CLASSIFY_BIT_S 5 #define QDF_CE_TX_CLASSIFY_BIT_S 5
@@ -1466,6 +1511,7 @@ enum qdf_suspend_type {
* @QDF_VDEV_SM_OUT_OF_SYNC: Vdev SM is out of sync and connect req received * @QDF_VDEV_SM_OUT_OF_SYNC: Vdev SM is out of sync and connect req received
* when already connected * when already connected
* @QDF_STATS_REQ_TIMEDOUT: Stats request timedout * @QDF_STATS_REQ_TIMEDOUT: Stats request timedout
* @QDF_TX_DESC_LEAK: tx desc leak
*/ */
enum qdf_hang_reason { enum qdf_hang_reason {
QDF_REASON_UNSPECIFIED, QDF_REASON_UNSPECIFIED,
@@ -1559,7 +1605,7 @@ enum qdf_context_mode {
* enum qdf_dp_tx_rx_status - TX/RX packet status * enum qdf_dp_tx_rx_status - TX/RX packet status
* @QDF_TX_RX_STATUS_INVALID: default invalid status * @QDF_TX_RX_STATUS_INVALID: default invalid status
* @QDF_TX_RX_STATUS_OK: successfully sent + acked * @QDF_TX_RX_STATUS_OK: successfully sent + acked
* @QDF_TX_RX_STATUS_DISCARD: queued but not sent over air * @QDF_TX_RX_STATUS_FW_DISCARD: queued but not sent over air
* @QDF_TX_RX_STATUS_NO_ACK: packet sent but no ack received * @QDF_TX_RX_STATUS_NO_ACK: packet sent but no ack received
* @QDF_TX_RX_STATUS_DROP: packet dropped due to congestion * @QDF_TX_RX_STATUS_DROP: packet dropped due to congestion
* @QDF_TX_RX_STATUS_DOWNLOAD_SUCC: packet delivered to target * @QDF_TX_RX_STATUS_DOWNLOAD_SUCC: packet delivered to target
@@ -1613,12 +1659,7 @@ enum qdf_dp_a_status {
* @QDF_DOMAIN_ATTR_FSL_PAMUV1: Domain attribute fsl pamu v1 * @QDF_DOMAIN_ATTR_FSL_PAMUV1: Domain attribute fsl pamu v1
* @QDF_DOMAIN_ATTR_NESTING: Domain attribute Nesting * @QDF_DOMAIN_ATTR_NESTING: Domain attribute Nesting
* @QDF_DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE: Domain attribute dma use flush queue * @QDF_DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE: Domain attribute dma use flush queue
* @QDF_DOMAIN_ATTR_PT_BASE_ADDR: Domain attribute pt base address
* @QDF_DOMAIN_ATTR_CONTEXT_BANK: Domain attribute context bank * @QDF_DOMAIN_ATTR_CONTEXT_BANK: Domain attribute context bank
* @QDF_DOMAIN_ATTR_DYNAMIC: Domain attribute dynamic
* @QDF_DOMAIN_ATTR_TTBR0: Domain attribute TTBR0
* @QDF_DOMAIN_ATTR_CONTEXTIDR: Domain attribute contextidr
* @QDF_DOMAIN_ATTR_PROCID: Domain attribute procid
* @QDF_DOMAIN_ATTR_NON_FATAL_FAULTS: Domain attribute non fatal faults * @QDF_DOMAIN_ATTR_NON_FATAL_FAULTS: Domain attribute non fatal faults
* @QDF_DOMAIN_ATTR_S1_BYPASS: Domain attribute S1 bypass * @QDF_DOMAIN_ATTR_S1_BYPASS: Domain attribute S1 bypass
* @QDF_DOMAIN_ATTR_ATOMIC: Domain attribute atomic * @QDF_DOMAIN_ATTR_ATOMIC: Domain attribute atomic

View File

@@ -34,7 +34,7 @@
typedef struct workqueue_struct __qdf_workqueue_t; typedef struct workqueue_struct __qdf_workqueue_t;
/** /**
* __qdf_work_t - wrapper around the real task func * typedef struct __qdf_work_t - wrapper around the real task func
* @work: Instance of work * @work: Instance of work
* @fn: function pointer to the handler * @fn: function pointer to the handler
* @arg: pointer to argument * @arg: pointer to argument
@@ -46,7 +46,7 @@ typedef struct {
} __qdf_work_t; } __qdf_work_t;
/** /**
* __qdf_bh_t - wrapper around the real task func * typedef struct __qdf_bh_t - wrapper around the real task func
* @bh: Instance of the bottom half * @bh: Instance of the bottom half
* @fn: function pointer to the handler * @fn: function pointer to the handler
* @arg: pointer to argument * @arg: pointer to argument
@@ -261,4 +261,25 @@ static inline void __qdf_disable_bh(__qdf_bh_t *bh)
tasklet_kill(&bh->bh); tasklet_kill(&bh->bh);
} }
/**
* __qdf_local_bh_disable - disables softirq and tasklet processing
* on the local processor
*
* Return: none
*/
static inline void __qdf_local_bh_disable(void)
{
local_bh_disable();
}
/**
* __qdf_local_bh_enable - Enables softirq and tasklet processing
* on the local processor
*
* Return: none
*/
static inline void __qdf_local_bh_enable(void)
{
local_bh_enable();
}
#endif /*_I_QDF_DEFER_H*/ #endif /*_I_QDF_DEFER_H*/

View File

@@ -51,7 +51,7 @@ __qdf_net_if_create_dummy_if(struct qdf_net_if *nif)
} }
/** /**
* qdf_net_if_get_dev_by_name() - Find a network device by its name * __qdf_net_if_get_dev_by_name() - Find a network device by its name
* @nif_name: network device name * @nif_name: network device name
* *
* This function retrieves the network device by its name * This function retrieves the network device by its name
@@ -68,7 +68,7 @@ __qdf_net_if_get_dev_by_name(char *nif_name)
} }
/** /**
* qdf_net_if_release_dev() - Release reference to network device * __qdf_net_if_release_dev() - Release reference to network device
* @nif: network device * @nif: network device
* *
* This function releases reference to the network device * This function releases reference to the network device
@@ -88,7 +88,7 @@ __qdf_net_if_release_dev(struct qdf_net_if *nif)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
/** /**
* qdf_net_update_net_device_dev_addr() - update net_device dev_addr * __qdf_net_update_net_device_dev_addr() - update net_device dev_addr
* @ndev: net_device * @ndev: net_device
* @src_addr: source mac address * @src_addr: source mac address
* @len: length * @len: length
@@ -107,7 +107,7 @@ __qdf_net_update_net_device_dev_addr(struct net_device *ndev,
} }
#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)) */ #else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)) */
/** /**
* qdf_net_update_net_device_dev_addr() - update net_device dev_addr * __qdf_net_update_net_device_dev_addr() - update net_device dev_addr
* @ndev: net_device * @ndev: net_device
* @src_addr: source mac address * @src_addr: source mac address
* @len: length * @len: length
@@ -125,4 +125,46 @@ __qdf_net_update_net_device_dev_addr(struct net_device *ndev,
} }
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)) */ #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)) */
/**
* __qdf_napi_enable() - Enable the napi schedule
* @napi: NAPI context
*
* This function resume NAPI from being scheduled on this context
*
* Return: NONE
*/
static inline void
__qdf_napi_enable(struct napi_struct *napi)
{
napi_enable(napi);
}
/**
* __qdf_netif_napi_add - initialize a NAPI context
* @netdev: network device
* @napi: NAPI context
* @poll: polling function
* @weight: default weight
*
* Return: NONE
*/
static inline void
__qdf_netif_napi_add(struct net_device *netdev, struct napi_struct *napi,
int (*poll)(struct napi_struct *, int), int weight)
{
netif_napi_add(netdev, napi, poll, weight);
}
/**
* __qdf_netif_napi_del: remove a NAPI context
* @napi: NAPI context
*
* Return: NONE
*/
static inline void
__qdf_netif_napi_del(struct napi_struct *napi)
{
netif_napi_del(napi);
}
#endif /*__I_QDF_NET_IF_H */ #endif /*__I_QDF_NET_IF_H */

View File

@@ -156,7 +156,7 @@ typedef unsigned long __sgtable_t;
#define __bool_already_defined__ #define __bool_already_defined__
/** /**
* bool - This is an enum for boolean * typedef bool - This is an enum for boolean
* @false: zero * @false: zero
* @true: one * @true: one
*/ */
@@ -170,7 +170,7 @@ typedef enum bool {
#define __qdf_packed __attribute__((packed)) #define __qdf_packed __attribute__((packed))
typedef int (*__qdf_os_intr)(void *); typedef int (*__qdf_os_intr)(void *);
/** /*
* Private definitions of general data types * Private definitions of general data types
*/ */
typedef dma_addr_t __qdf_dma_addr_t; typedef dma_addr_t __qdf_dma_addr_t;
@@ -186,6 +186,7 @@ typedef __le64 __qdf_le64_t;
typedef __be16 __qdf_be16_t; typedef __be16 __qdf_be16_t;
typedef __be32 __qdf_be32_t; typedef __be32 __qdf_be32_t;
typedef __be64 __qdf_be64_t; typedef __be64 __qdf_be64_t;
typedef struct net_device __qdf_dummy_netdev_t;
#if defined(IPA_OFFLOAD) && defined(__KERNEL__) #if defined(IPA_OFFLOAD) && defined(__KERNEL__)
typedef struct ipa_wdi_buffer_info __qdf_mem_info_t; typedef struct ipa_wdi_buffer_info __qdf_mem_info_t;
@@ -209,7 +210,7 @@ typedef struct __qdf_shared_mem_info {
#define qdf_get_dma_mem_context(var, field) ((qdf_dma_context_t)(var->field)) #define qdf_get_dma_mem_context(var, field) ((qdf_dma_context_t)(var->field))
/** /**
* typedef struct __qdf_resource_t - qdf resource type * typedef struct __qdf_resource - qdf resource type
* @paddr: Physical address * @paddr: Physical address
* @paddr: Virtual address * @paddr: Virtual address
* @len: Length * @len: Length
@@ -231,6 +232,7 @@ struct __qdf_mempool_ctxt;
* @QDF_BUS_TYPE_AHB: AHB Bus * @QDF_BUS_TYPE_AHB: AHB Bus
* @QDF_BUS_TYPE_SNOC: SNOC Bus * @QDF_BUS_TYPE_SNOC: SNOC Bus
* @QDF_BUS_TYPE_SIM: Simulator * @QDF_BUS_TYPE_SIM: Simulator
* @QDF_BUS_TYPE_SDIO: SDIO
* @QDF_BUS_TYPE_USB: USB Bus * @QDF_BUS_TYPE_USB: USB Bus
* @QDF_BUS_TYPE_IPCI: IPCI Bus * @QDF_BUS_TYPE_IPCI: IPCI Bus
*/ */
@@ -259,6 +261,7 @@ enum qdf_bus_type {
* @bus_type: Bus type * @bus_type: Bus type
* @bid: Bus ID * @bid: Bus ID
* @smmu_s1_enabled: SMMU S1 enabled or not * @smmu_s1_enabled: SMMU S1 enabled or not
* @domain: domain type
* @iommu_mapping: DMA iommu mapping pointer * @iommu_mapping: DMA iommu mapping pointer
*/ */
struct __qdf_device { struct __qdf_device {
@@ -301,7 +304,7 @@ typedef struct __qdf_segment {
} __qdf_segment_t; } __qdf_segment_t;
/** /**
* __qdf_dma_map - dma map of memory * struct __qdf_dma_map: dma map of memory
* @mapped: mapped address * @mapped: mapped address
* @nsegs: number of segments * @nsegs: number of segments
* @coherent: coherency status * @coherent: coherency status
@@ -316,7 +319,7 @@ struct __qdf_dma_map {
typedef struct __qdf_dma_map *__qdf_dma_map_t; typedef struct __qdf_dma_map *__qdf_dma_map_t;
/** /**
* __qdf_net_wireless_evcode - enum for event code * enum __qdf_net_wireless_evcode: enum for event code
* @__QDF_IEEE80211_ASSOC: association event code * @__QDF_IEEE80211_ASSOC: association event code
* @__QDF_IEEE80211_REASSOC: reassociation event code * @__QDF_IEEE80211_REASSOC: reassociation event code
* @__QDF_IEEE80211_DISASSOC: disassociation event code * @__QDF_IEEE80211_DISASSOC: disassociation event code

View File

@@ -159,4 +159,18 @@ void qdf_flush_workqueue(qdf_handle_t hdl, qdf_workqueue_t *wqueue)
} }
qdf_export_symbol(qdf_flush_workqueue); qdf_export_symbol(qdf_flush_workqueue);
void qdf_local_bh_disable(void)
{
__qdf_local_bh_disable();
}
qdf_export_symbol(qdf_local_bh_disable);
void qdf_local_bh_enable(void)
{
__qdf_local_bh_enable();
}
qdf_export_symbol(qdf_local_bh_enable);
#endif #endif

View File

@@ -109,3 +109,25 @@ qdf_net_update_net_device_dev_addr(struct net_device *ndev,
} }
qdf_export_symbol(qdf_net_update_net_device_dev_addr); qdf_export_symbol(qdf_net_update_net_device_dev_addr);
void qdf_napi_enable(struct napi_struct *napi)
{
napi_enable(napi);
}
qdf_export_symbol(qdf_napi_enable);
void qdf_netif_napi_add(struct net_device *netdev, struct napi_struct *napi,
int (*poll)(struct napi_struct *, int), int weight)
{
netif_napi_add(netdev, napi, poll, weight);
}
qdf_export_symbol(qdf_netif_napi_add);
void qdf_netif_napi_del(struct napi_struct *napi)
{
netif_napi_del(napi);
}
qdf_export_symbol(qdf_netif_napi_del);

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -122,6 +123,8 @@ QDF_STATUS qdf_status_from_os_return(int rc)
return QDF_STATUS_E_PENDING; return QDF_STATUS_E_PENDING;
case -ETIMEDOUT: case -ETIMEDOUT:
return QDF_STATUS_E_TIMEOUT; return QDF_STATUS_E_TIMEOUT;
case -ERESTARTSYS:
return QDF_STATUS_E_RESTART;
default: default:
return QDF_STATUS_E_PERM; return QDF_STATUS_E_PERM;
} }

View File

@@ -43,7 +43,7 @@
#include <linux/stacktrace.h> #include <linux/stacktrace.h>
#include <qdf_defer.h> #include <qdf_defer.h>
#include <qdf_module.h> #include <qdf_module.h>
#include <linux/cpumask.h>
/* Function declarations and documentation */ /* Function declarations and documentation */
typedef int (*qdf_thread_os_func)(void *data); typedef int (*qdf_thread_os_func)(void *data);
@@ -313,3 +313,13 @@ void qdf_cpumask_or(qdf_cpu_mask *dstp, qdf_cpu_mask *src1p,
} }
qdf_export_symbol(qdf_cpumask_or); qdf_export_symbol(qdf_cpumask_or);
void
qdf_thread_cpumap_print_to_pagebuf(bool list, char *new_mask_str,
qdf_cpu_mask *new_mask)
{
cpumap_print_to_pagebuf(list, new_mask_str, new_mask);
}
qdf_export_symbol(qdf_thread_cpumap_print_to_pagebuf);