Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 636f8288 authored by Kalle Valo's avatar Kalle Valo
Browse files

ath6kl: Add HTC pipe implementation



This is needed for USB.

Based on code by Kevin Fang.

Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent e76ac2bf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ obj-$(CONFIG_ATH6KL) += ath6kl_core.o
ath6kl_core-y += debug.o
ath6kl_core-y += hif.o
ath6kl_core-y += htc_mbox.o
ath6kl_core-y += htc_pipe.o
ath6kl_core-y += bmi.o
ath6kl_core-y += cfg80211.o
ath6kl_core-y += init.o
+15 −0
Original line number Diff line number Diff line
@@ -40,6 +40,18 @@ module_param(uart_debug, uint, 0644);
module_param(ath6kl_p2p, uint, 0644);
module_param(testmode, uint, 0644);

void ath6kl_core_tx_complete(struct ath6kl *ar, struct sk_buff *skb)
{
	ath6kl_htc_tx_complete(ar, skb);
}
EXPORT_SYMBOL(ath6kl_core_tx_complete);

void ath6kl_core_rx_complete(struct ath6kl *ar, struct sk_buff *skb, u8 pipe)
{
	ath6kl_htc_rx_complete(ar, skb, pipe);
}
EXPORT_SYMBOL(ath6kl_core_rx_complete);

int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type)
{
	struct ath6kl_bmi_target_info targ_info;
@@ -50,6 +62,9 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type)
	case ATH6KL_HTC_TYPE_MBOX:
		ath6kl_htc_mbox_attach(ar);
		break;
	case ATH6KL_HTC_TYPE_PIPE:
		ath6kl_htc_pipe_attach(ar);
		break;
	default:
		WARN_ON(1);
		return -ENOMEM;
+4 −0
Original line number Diff line number Diff line
@@ -464,6 +464,7 @@ enum ath6kl_hif_type {

enum ath6kl_htc_type {
	ATH6KL_HTC_TYPE_MBOX,
	ATH6KL_HTC_TYPE_PIPE,
};

/* Max number of filters that hw supports */
@@ -835,6 +836,9 @@ int ath6kl_init_hw_params(struct ath6kl *ar);

void ath6kl_check_wow_status(struct ath6kl *ar);

void ath6kl_core_tx_complete(struct ath6kl *ar, struct sk_buff *skb);
void ath6kl_core_rx_complete(struct ath6kl *ar, struct sk_buff *skb, u8 pipe);

struct ath6kl *ath6kl_core_create(struct device *dev);
int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type);
void ath6kl_core_cleanup(struct ath6kl *ar);
+34 −0
Original line number Diff line number Diff line
@@ -150,4 +150,38 @@ static inline void ath6kl_hif_stop(struct ath6kl *ar)
	ar->hif_ops->stop(ar);
}

static inline int ath6kl_hif_pipe_send(struct ath6kl *ar,
				       u8 pipe, struct sk_buff *hdr_buf,
				       struct sk_buff *buf)
{
	ath6kl_dbg(ATH6KL_DBG_HIF, "hif pipe send\n");

	return ar->hif_ops->pipe_send(ar, pipe, hdr_buf, buf);
}

static inline void ath6kl_hif_pipe_get_default(struct ath6kl *ar,
					       u8 *ul_pipe, u8 *dl_pipe)
{
	ath6kl_dbg(ATH6KL_DBG_HIF, "hif pipe get default\n");

	ar->hif_ops->pipe_get_default(ar, ul_pipe, dl_pipe);
}

static inline int ath6kl_hif_pipe_map_service(struct ath6kl *ar,
					      u16 service_id, u8 *ul_pipe,
					      u8 *dl_pipe)
{
	ath6kl_dbg(ATH6KL_DBG_HIF, "hif pipe get default\n");

	return ar->hif_ops->pipe_map_service(ar, service_id, ul_pipe, dl_pipe);
}

static inline u16 ath6kl_hif_pipe_get_free_queue_number(struct ath6kl *ar,
							u8 pipe)
{
	ath6kl_dbg(ATH6KL_DBG_HIF, "hif pipe get free queue number\n");

	return ar->hif_ops->pipe_get_free_queue_number(ar, pipe);
}

#endif
+6 −0
Original line number Diff line number Diff line
@@ -256,6 +256,12 @@ struct ath6kl_hif_ops {
	int (*power_on)(struct ath6kl *ar);
	int (*power_off)(struct ath6kl *ar);
	void (*stop)(struct ath6kl *ar);
	int (*pipe_send)(struct ath6kl *ar, u8 pipe, struct sk_buff *hdr_buf,
			 struct sk_buff *buf);
	void (*pipe_get_default)(struct ath6kl *ar, u8 *pipe_ul, u8 *pipe_dl);
	int (*pipe_map_service)(struct ath6kl *ar, u16 service_id, u8 *pipe_ul,
				u8 *pipe_dl);
	u16 (*pipe_get_free_queue_number)(struct ath6kl *ar, u8 pipe);
};

int ath6kl_hif_setup(struct ath6kl_device *dev);
Loading