linux/drivers/net/wireless/morsemicro/mm81x/hif.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

118 lines
3.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2017-2026 Morse Micro
*/
#ifndef _MM81X_HIF_H_
#define _MM81X_HIF_H_
#include "core.h"
struct mm81x_skbq;
#define MM81X_HIF_BYPASS_TX_STATUS_IRQ_NUM (15)
#define MM81X_HIF_BYPASS_CMD_RESP_IRQ_NUM (29)
#define MM81X_HIF_IRQ_BYPASS_TX_STATUS_AVAILABLE \
BIT(MM81X_HIF_BYPASS_TX_STATUS_IRQ_NUM)
#define MM81X_HIF_IRQ_BYPASS_CMD_RESP_AVAILABLE \
BIT(MM81X_HIF_BYPASS_CMD_RESP_IRQ_NUM)
/* Hardware IF interrupt mask. We may use any interrupts in this range */
#define MM81X_HIF_IRQ_MASK_ALL \
(GENMASK(13, 0) | MM81X_HIF_IRQ_BYPASS_TX_STATUS_AVAILABLE | \
MM81X_HIF_IRQ_BYPASS_CMD_RESP_AVAILABLE)
enum mm81x_hif_flags {
MM81X_HIF_FLAGS_DIR_TO_HOST = BIT(0),
MM81X_HIF_FLAGS_DIR_TO_CHIP = BIT(1),
MM81X_HIF_FLAGS_COMMAND = BIT(2),
MM81X_HIF_FLAGS_BEACON = BIT(3),
MM81X_HIF_FLAGS_DATA = BIT(4)
};
struct mm81x_hif_ops {
int (*init)(struct mm81x *mors);
void (*flush_tx_data)(struct mm81x *mors);
void (*flush_cmds)(struct mm81x *mors);
void (*finish)(struct mm81x *mors);
void (*skbq_get_tx_qs)(struct mm81x *mors, struct mm81x_skbq **qs,
int *num_qs);
struct mm81x_skbq *(*get_tx_cmd_queue)(struct mm81x *mors);
struct mm81x_skbq *(*get_tx_beacon_queue)(struct mm81x *mors);
struct mm81x_skbq *(*get_tx_mgmt_queue)(struct mm81x *mors);
struct mm81x_skbq *(*get_tx_data_queue)(struct mm81x *mors, int aci);
int (*handle_irq)(struct mm81x *mors, u32 status);
int (*get_tx_buffered_count)(struct mm81x *mors);
int (*get_tx_status_pending_count)(struct mm81x *mors);
};
static inline void mm81x_hif_clear_events(struct mm81x *mors)
{
mors->hif.event_flags = 0;
}
static inline int mm81x_hif_init(struct mm81x *mors)
{
return mors->hif.ops->init(mors);
}
static inline void mm81x_hif_flush_tx_data(struct mm81x *mors)
{
mors->hif.ops->flush_tx_data(mors);
}
static inline void mm81x_hif_flush_cmds(struct mm81x *mors)
{
mors->hif.ops->flush_cmds(mors);
}
static inline void mm81x_hif_finish(struct mm81x *mors)
{
mors->hif.ops->finish(mors);
}
static inline void mm81x_hif_skbq_get_tx_qs(struct mm81x *mors,
struct mm81x_skbq **qs, int *num_qs)
{
mors->hif.ops->skbq_get_tx_qs(mors, qs, num_qs);
}
static inline struct mm81x_skbq *mm81x_hif_get_tx_cmd_queue(struct mm81x *mors)
{
return mors->hif.ops->get_tx_cmd_queue(mors);
}
static inline struct mm81x_skbq *
mm81x_hif_get_tx_beacon_queue(struct mm81x *mors)
{
return mors->hif.ops->get_tx_beacon_queue(mors);
}
static inline struct mm81x_skbq *mm81x_hif_get_tx_mgmt_queue(struct mm81x *mors)
{
return mors->hif.ops->get_tx_mgmt_queue(mors);
}
static inline struct mm81x_skbq *mm81x_hif_get_tx_data_queue(struct mm81x *mors,
int aci)
{
return mors->hif.ops->get_tx_data_queue(mors, aci);
}
static inline int mm81x_hif_handle_irq(struct mm81x *mors, u32 status)
{
return mors->hif.ops->handle_irq(mors, status);
}
static inline int mm81x_hif_get_tx_buffered_count(struct mm81x *mors)
{
return mors->hif.ops->get_tx_buffered_count(mors);
}
static inline int mm81x_hif_get_tx_status_pending_count(struct mm81x *mors)
{
return mors->hif.ops->get_tx_status_pending_count(mors);
}
#endif /* _MM81X_HIF_H_ */