#include <net/iw_handler.h>
#include "host.h"
#include "hostcmd.h"
-#include "sbi.h"
#include "decl.h"
#include "defs.h"
#include "dev.h"
cmdnode->cmdwaitqwoken = 0;
cmdsize = cpu_to_le16(cmdsize);
- ret = libertas_sbi_host_to_card(priv, MVMS_CMD, (u8 *) cmdptr, cmdsize);
+ ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmdptr, cmdsize);
if (ret != 0) {
lbs_deb_cmd("DNLD_CMD: Host to Card failed\n");
lbs_dbg_hex("SEND_SLEEPC_CMD: Sleep confirm command", cmdptr, size);
- ret = libertas_sbi_host_to_card(priv, MVMS_CMD, cmdptr, size);
+ ret = priv->hw_host_to_card(priv, MVMS_CMD, cmdptr, size);
priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED;
spin_lock_irqsave(&adapter->driver_lock, flags);
#include <net/iw_handler.h>
#include "host.h"
-#include "sbi.h"
#include "decl.h"
#include "defs.h"
#include "dev.h"
int wlan_add_mesh(wlan_private *priv);
void wlan_remove_mesh(wlan_private *priv);
+/* preliminary here */
+int if_usb_register(void);
+void if_usb_unregister(void);
+
+
#endif /* _WLAN_DECL_H_ */
#define MRVDRV_MAX_BEACON_INTERVAL 1000
#define MRVDRV_BEACON_INTERVAL 100
+/** INT status Bit Definition*/
+#define his_cmddnldrdy 0x01
+#define his_cardevent 0x02
+#define his_cmdupldrdy 0x04
+
+#define SBI_EVENT_CAUSE_SHIFT 3
+
/** TxPD status */
/* Station firmware use TxPD status field to report final Tx transmit
struct delayed_work assoc_work;
struct workqueue_struct *assoc_thread;
+
+ /** Hardware access */
+ int (*hw_register_dev) (wlan_private * priv);
+ int (*hw_unregister_dev) (wlan_private *);
+ int (*hw_prog_firmware) (wlan_private *);
+ int (*hw_host_to_card) (wlan_private * priv, u8 type, u8 * payload, u16 nb);
+ int (*hw_get_int_status) (wlan_private * priv, u8 *);
+ int (*hw_read_event_cause) (wlan_private *);
};
/** Association request
-
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/delay.h>
#include "host.h"
-#include "sbi.h"
#include "decl.h"
#include "defs.h"
#include "dev.h"
#include <linux/firmware.h>
#include "host.h"
-#include "sbi.h"
#include "defs.h"
#include "decl.h"
#include "dev.h"
goto done;
}
- ret = libertas_sbi_prog_firmware(priv);
+ ret = priv->hw_prog_firmware(priv);
release_firmware(priv->firmware);
#include <linux/usb.h>
#include "host.h"
-#include "sbi.h"
#include "decl.h"
#include "defs.h"
#include "dev.h"
static void if_usb_receive(struct urb *urb);
static void if_usb_receive_fwload(struct urb *urb);
static int reset_device(wlan_private *priv);
+static int if_usb_register_dev(wlan_private * priv);
+static int if_usb_unregister_dev(wlan_private *);
+static int if_usb_prog_firmware(wlan_private *);
+static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb);
+static int if_usb_get_int_status(wlan_private * priv, u8 *);
+static int if_usb_read_event_cause(wlan_private *);
/**
* @brief call back function to handle the status of the URB
/* At this point wlan_add_card() will be called. Don't worry
* about keeping pwlanpriv around since it will be set on our
- * usb device data in -> add() -> libertas_sbi_register_dev().
+ * usb device data in -> add() -> hw_register_dev() -> if_usb_register_dev.
*/
if (!(priv = wlan_add_card(usb_cardp)))
goto dealloc;
if (wlan_add_mesh(priv))
goto err_add_mesh;
+ priv->hw_register_dev = if_usb_register_dev;
+ priv->hw_unregister_dev = if_usb_unregister_dev;
+ priv->hw_prog_firmware = if_usb_prog_firmware;
+ priv->hw_host_to_card = if_usb_host_to_card;
+ priv->hw_get_int_status = if_usb_get_int_status;
+ priv->hw_read_event_cause = if_usb_read_event_cause;
+
if (libertas_activate_card(priv))
goto err_activate_card;
* @param len number of bytes
* @return 0 or -1
*/
-int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb)
+static int if_usb_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb)
{
int ret = -1;
u32 tmp;
}
/* called with adapter->driver_lock held */
-int libertas_sbi_get_int_status(wlan_private * priv, u8 * ireg)
+static int if_usb_get_int_status(wlan_private * priv, u8 * ireg)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
return 0;
}
-int libertas_sbi_read_event_cause(wlan_private * priv)
+static int if_usb_read_event_cause(wlan_private * priv)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
priv->adapter->eventcause = cardp->usb_event_cause;
return ret;
}
-int libertas_sbi_unregister_dev(wlan_private * priv)
+static int if_usb_unregister_dev(wlan_private * priv)
{
int ret = 0;
* @param priv pointer to wlan_private
* @return 0 or -1
*/
-int libertas_sbi_register_dev(wlan_private * priv)
+static int if_usb_register_dev(wlan_private * priv)
{
struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card;
-int libertas_sbi_prog_firmware(wlan_private * priv)
+static int if_usb_prog_firmware(wlan_private * priv)
{
struct usb_card_rec *cardp = priv->wlan_dev.card;
int i = 0;
* @param arg pointer to call back function parameter
* @return dummy success variable
*/
-int libertas_sbi_register(void)
+int if_usb_register(void)
{
/*
* API registers the Marvell USB driver
* @brief This function removes usb driver.
* @return N/A
*/
-void libertas_sbi_unregister(void)
+void if_usb_unregister(void)
{
int i;
#include <net/ieee80211.h>
#include "host.h"
-#include "sbi.h"
#include "decl.h"
#include "dev.h"
#include "fw.h"
if (adapter->intcounter) {
u8 int_status;
adapter->intcounter = 0;
- int_status = libertas_sbi_get_int_status(priv, &ireg);
+ int_status = priv->hw_get_int_status(priv, &ireg);
if (int_status) {
lbs_deb_thread(
adapter->hisregcpy &= ~his_cardevent;
- if (libertas_sbi_read_event_cause(priv)) {
+ if (priv->hw_read_event_cause(priv)) {
lbs_pr_alert(
- "main-thread: libertas_sbi_read_event_cause failed\n");
+ "main-thread: hw_read_event_cause failed\n");
spin_unlock_irq(&adapter->driver_lock);
continue;
}
* relevant information from the card and request for the required
* IRQ.
*/
- if (libertas_sbi_register_dev(priv) < 0) {
+ if (priv->hw_register_dev(priv) < 0) {
lbs_pr_err("failed to register WLAN device\n");
goto err_registerdev;
}
goto done;
err_init_fw:
- libertas_sbi_unregister_dev(priv);
+ priv->hw_unregister_dev(priv);
err_registerdev:
destroy_workqueue(priv->assoc_thread);
/* Stop the thread servicing the interrupts */
libertas_debugfs_init();
- if (libertas_sbi_register()) {
+ if (if_usb_register()) {
ret = -1;
libertas_debugfs_remove();
}
{
lbs_deb_enter(LBS_DEB_MAIN);
- libertas_sbi_unregister();
+ if_usb_unregister();
libertas_debugfs_remove();
lbs_deb_leave(LBS_DEB_MAIN);
+++ /dev/null
-/**
- * This file contains IF layer definitions.
- */
-
-#ifndef _SBI_H_
-#define _SBI_H_
-
-#include <linux/interrupt.h>
-
-#include "defs.h"
-
-/** INT status Bit Definition*/
-#define his_cmddnldrdy 0x01
-#define his_cardevent 0x02
-#define his_cmdupldrdy 0x04
-
-#define SBI_EVENT_CAUSE_SHIFT 3
-
-/* Probe and Check if the card is present*/
-int libertas_sbi_register_dev(wlan_private * priv);
-int libertas_sbi_unregister_dev(wlan_private *);
-int libertas_sbi_get_int_status(wlan_private * priv, u8 *);
-int libertas_sbi_register(void);
-void libertas_sbi_unregister(void);
-int libertas_sbi_prog_firmware(wlan_private *);
-
-int libertas_sbi_read_event_cause(wlan_private *);
-int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb);
-
-#endif /* _SBI_H */
#include "hostcmd.h"
#include "radiotap.h"
-#include "sbi.h"
#include "decl.h"
#include "defs.h"
#include "dev.h"
lbs_dbg_hex("Tx Data", (u8 *) p802x_hdr, plocaltxpd->tx_packet_length);
memcpy(ptr, p802x_hdr, plocaltxpd->tx_packet_length);
- ret = libertas_sbi_host_to_card(priv, MVMS_DAT,
- priv->adapter->tmptxbuf,
- plocaltxpd->tx_packet_length +
- sizeof(struct txpd));
+ ret = priv->hw_host_to_card(priv, MVMS_DAT,
+ priv->adapter->tmptxbuf,
+ plocaltxpd->tx_packet_length +
+ sizeof(struct txpd));
if (ret) {
- lbs_deb_tx("tx err: libertas_sbi_host_to_card returned 0x%X\n", ret);
+ lbs_deb_tx("tx err: hw_host_to_card returned 0x%X\n", ret);
goto done;
}