Commit 208fdd2f authored by Holger Schurig's avatar Holger Schurig Committed by John W. Linville
Browse files

[PATCH] libertas: indirect all hardware access via hw_XXXX functions



This functions makes all libertas_sbi_XXX functions static to the
if_usb.c file and renames them to if_usb_XXXX(). The get called from
other places of the source code via priv->hw_XXXX().

Signed-off-by: default avatarHolger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0583e8ef
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
#include <net/iw_handler.h>
#include "host.h"
#include "hostcmd.h"
#include "sbi.h"
#include "decl.h"
#include "defs.h"
#include "dev.h"
@@ -1014,7 +1013,7 @@ static int DownloadcommandToStation(wlan_private * priv,
	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");
@@ -1841,7 +1840,7 @@ static int sendconfirmsleep(wlan_private * priv, u8 * cmdptr, u16 size)

	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);
+0 −1
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@
#include <net/iw_handler.h>

#include "host.h"
#include "sbi.h"
#include "decl.h"
#include "defs.h"
#include "dev.h"
+5 −0
Original line number Diff line number Diff line
@@ -82,4 +82,9 @@ int wlan_remove_card(wlan_private *priv);
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_ */
+7 −0
Original line number Diff line number Diff line
@@ -155,6 +155,13 @@ static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len)
#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
+8 −0
Original line number Diff line number Diff line
@@ -162,6 +162,14 @@ struct _wlan_private {

	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
Loading