| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2008, cozybit Inc. |
|---|
| 3 | 4 | * Copyright (C) 2007, Red Hat, Inc. |
|---|
| 4 | 5 | * Copyright (C) 2003-2006, Marvell International Ltd. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or (at |
|---|
| 9 | | - * your option) any later version. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | #include <linux/spinlock.h> |
|---|
| 12 | 8 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 173 | 169 | |
|---|
| 174 | 170 | struct if_usb_card; |
|---|
| 175 | 171 | |
|---|
| 172 | +struct lbtf_ops { |
|---|
| 173 | + /** Hardware access */ |
|---|
| 174 | + int (*hw_host_to_card)(struct lbtf_private *priv, u8 type, |
|---|
| 175 | + u8 *payload, u16 nb); |
|---|
| 176 | + int (*hw_prog_firmware)(struct lbtf_private *priv); |
|---|
| 177 | + int (*hw_reset_device)(struct lbtf_private *priv); |
|---|
| 178 | +}; |
|---|
| 179 | + |
|---|
| 176 | 180 | /** Private structure for the MV device */ |
|---|
| 177 | 181 | struct lbtf_private { |
|---|
| 178 | 182 | void *card; |
|---|
| 179 | 183 | struct ieee80211_hw *hw; |
|---|
| 184 | + const struct lbtf_ops *ops; |
|---|
| 180 | 185 | |
|---|
| 181 | 186 | /* Command response buffer */ |
|---|
| 182 | 187 | u8 cmd_resp_buff[LBS_UPLD_SIZE]; |
|---|
| .. | .. |
|---|
| 188 | 193 | |
|---|
| 189 | 194 | struct work_struct cmd_work; |
|---|
| 190 | 195 | struct work_struct tx_work; |
|---|
| 191 | | - /** Hardware access */ |
|---|
| 192 | | - int (*hw_host_to_card) (struct lbtf_private *priv, u8 type, u8 *payload, u16 nb); |
|---|
| 193 | | - int (*hw_prog_firmware) (struct if_usb_card *cardp); |
|---|
| 194 | | - int (*hw_reset_device) (struct if_usb_card *cardp); |
|---|
| 195 | | - |
|---|
| 196 | 196 | |
|---|
| 197 | 197 | /** Wlan adapter data structure*/ |
|---|
| 198 | 198 | /** STATUS variables */ |
|---|
| .. | .. |
|---|
| 250 | 250 | struct ieee80211_supported_band band; |
|---|
| 251 | 251 | struct lbtf_offset_value offsetvalue; |
|---|
| 252 | 252 | |
|---|
| 253 | | - u8 fw_ready; |
|---|
| 254 | 253 | u8 surpriseremoved; |
|---|
| 255 | 254 | struct sk_buff_head bc_ps_buf; |
|---|
| 256 | 255 | |
|---|
| .. | .. |
|---|
| 486 | 485 | /* main.c */ |
|---|
| 487 | 486 | struct chan_freq_power *lbtf_get_region_cfp_table(u8 region, |
|---|
| 488 | 487 | int *cfp_no); |
|---|
| 489 | | -struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev); |
|---|
| 488 | +struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev, |
|---|
| 489 | + const struct lbtf_ops *ops); |
|---|
| 490 | 490 | int lbtf_remove_card(struct lbtf_private *priv); |
|---|
| 491 | 491 | int lbtf_start_card(struct lbtf_private *priv); |
|---|
| 492 | 492 | int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb); |
|---|