linux/drivers/net/wireless/morsemicro/mm81x/yaps.h
Lachlan Hodges b1906cea00 wifi: mm81x: add mm81x Wi-Fi HaLow driver
mm81x is the first Wi-Fi HaLow driver to support the Morse Micro mm81x
chip family via USB and SDIO.

S1G support in the kernel is only new, and as a result this driver has
been scoped to be simple and only support station and AP interface.
The Wi-Fi specific features only cover the minimum required for basic
use such as powersave, aggregation, rate control and so on. The driver
will be extended into the future as S1G support for operations such as
ACS, channel switching and so on are added into the wireless stack.

The driver has been build tested on a long list of architectures and
compilers via Intels LKP.

The driver currently supports IEEE80211-2024 US channels only, with
AU 2020 also available. In order for this to be expanded additional
non-trivial kernel work is required which will begin once the
driver is upstream.

The driver has had many authors who are listed below in
alphabetical order:

Co-developed-by: Andrew Pope <andrew.pope@morsemicro.com>
Signed-off-by: Andrew Pope <andrew.pope@morsemicro.com>
Co-developed-by: Arien Judge <arien.judge@morsemicro.com>
Signed-off-by: Arien Judge <arien.judge@morsemicro.com>
Co-developed-by: Ayman Grais <ayman.grais@morsemicro.com>
Signed-off-by: Ayman Grais <ayman.grais@morsemicro.com>
Co-developed-by: Bassem Dawood <bassem@morsemicro.com>
Signed-off-by: Bassem Dawood <bassem@morsemicro.com>
Co-developed-by: Chetan Mistry <chetan.mistry@morsemicro.com>
Signed-off-by: Chetan Mistry <chetan.mistry@morsemicro.com>
Co-developed-by: Dan Callaghan <dan.callaghan@morsemicro.com>
Signed-off-by: Dan Callaghan <dan.callaghan@morsemicro.com>
Co-developed-by: James Herbert <james.herbert@morsemicro.com>
Signed-off-by: James Herbert <james.herbert@morsemicro.com>
Co-developed-by: Sahand Maleki <sahand.maleki@morsemicro.com>
Signed-off-by: Sahand Maleki <sahand.maleki@morsemicro.com>
Co-developed-by: Simon Wadsworth <simon@morsemicro.com>
Signed-off-by: Simon Wadsworth <simon@morsemicro.com>
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
2026-07-08 12:03:50 +10:00

78 lines
1.9 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2017-2026 Morse Micro
*/
#ifndef _MM81X_YAPS_H_
#define _MM81X_YAPS_H_
#include <linux/skbuff.h>
#include <linux/workqueue.h>
#include "skbq.h"
#define YAPS_TX_SKBQ_MAX 4
struct mm81x_hif_ops;
extern const struct mm81x_hif_ops mm81x_yaps_ops;
enum mm81x_yaps_to_chip_q {
MM81X_YAPS_TX_Q = 0,
MM81X_YAPS_CMD_Q,
MM81X_YAPS_BEACON_Q,
MM81X_YAPS_MGMT_Q,
/* Keep this last */
MM81X_YAPS_NUM_TC_Q
};
struct mm81x_yaps_pkt {
struct sk_buff *skb;
enum mm81x_yaps_to_chip_q tc_queue;
};
struct mm81x_yaps {
struct mm81x *mors;
struct mm81x_yaps_hw_aux_data *aux_data;
const struct mm81x_yaps_ops *ops;
u8 flags;
struct {
struct mm81x_yaps_pkt *to_chip_pkts;
struct mm81x_yaps_pkt *from_chip_pkts;
} hw;
/* Chip interface is stopping, new work should not be enqueued. */
bool finish;
struct mm81x_skbq data_tx_qs[YAPS_TX_SKBQ_MAX];
struct mm81x_skbq beacon_q;
struct mm81x_skbq mgmt_q;
struct mm81x_skbq data_rx_q;
struct mm81x_skbq cmd_q;
struct mm81x_skbq cmd_resp_q;
struct {
struct timer_list timer;
unsigned long retry_expiry;
bool is_full;
} chip_queue_full;
};
struct mm81x_yaps_ops {
int (*write_pkts)(struct mm81x_yaps *yaps, struct mm81x_yaps_pkt *pkts,
int num_pkts, int *num_pkts_sent);
int (*read_pkts)(struct mm81x_yaps *yaps, struct mm81x_yaps_pkt *pkts,
int num_pkts_max, int *num_pkts_received);
int (*update_status)(struct mm81x_yaps *yaps);
};
int mm81x_yaps_init(struct mm81x *mors);
void mm81x_yaps_show(struct mm81x_yaps *yaps, struct seq_file *file);
void mm81x_yaps_finish(struct mm81x *mors);
void mm81x_yaps_flush_tx_data(struct mm81x *mors);
void mm81x_yaps_flush_cmds(struct mm81x *mors);
void mm81x_yaps_work(struct work_struct *work);
void mm81x_yaps_stale_tx_work(struct work_struct *work);
int mm81x_yaps_get_tx_status_pending_count(struct mm81x *mors);
int mm81x_yaps_get_tx_buffered_count(struct mm81x *mors);
#endif /* !_MM81X_YAPS_H_ */