summaryrefslogtreecommitdiff
path: root/sys/dev/ic/ar5211.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-03-05 15:13:27 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-03-05 15:13:27 +0000
commit611ac8e858d51e61f3ecbd0c79681bebcaf333c2 (patch)
tree3770fed7b4d79f346dbeb2c1efd5773d28f7d465 /sys/dev/ic/ar5211.c
parent073ca1d531cbf56050f3e3f97a32b545d40c1d9c (diff)
Add some HAL functions.
From madwifi-old-openhal via Nick Kossifidis (mickflemm at gmail dot com) Bump copyright while I'm here.
Diffstat (limited to 'sys/dev/ic/ar5211.c')
-rw-r--r--sys/dev/ic/ar5211.c69
1 files changed, 67 insertions, 2 deletions
diff --git a/sys/dev/ic/ar5211.c b/sys/dev/ic/ar5211.c
index 34fa1e7fdf5..3236b9865e3 100644
--- a/sys/dev/ic/ar5211.c
+++ b/sys/dev/ic/ar5211.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: ar5211.c,v 1.29 2007/02/14 00:53:48 jsg Exp $ */
+/* $OpenBSD: ar5211.c,v 1.30 2007/03/05 15:13:26 reyk Exp $ */
/*
- * Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
+ * Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -175,6 +175,22 @@ ar5k_ar5211_fill(struct ath_hal *hal)
AR5K_HAL_FUNCTION(hal, ar5211, eeprom_is_busy);
AR5K_HAL_FUNCTION(hal, ar5211, eeprom_read);
AR5K_HAL_FUNCTION(hal, ar5211, eeprom_write);
+
+ /*
+ * Unused functions or functions not implemented
+ */
+ AR5K_HAL_FUNCTION(hal, ar5211, get_tx_queueprops);
+ AR5K_HAL_FUNCTION(hal, ar5211, num_tx_pending);
+ AR5K_HAL_FUNCTION(hal, ar5211, phy_disable);
+ AR5K_HAL_FUNCTION(hal, ar5211, set_txpower_limit);
+ AR5K_HAL_FUNCTION(hal, ar5211, set_def_antenna);
+ AR5K_HAL_FUNCTION(hal, ar5211, get_def_antenna);
+ AR5K_HAL_FUNCTION(hal, ar5211, set_bssid_mask);
+#ifdef notyet
+ AR5K_HAL_FUNCTION(hal, ar5211, set_capability);
+ AR5K_HAL_FUNCTION(hal, ar5211, proc_mib_event);
+ AR5K_HAL_FUNCTION(hal, ar5211, get_tx_inter_queue);
+#endif
}
struct ath_hal *
@@ -391,6 +407,13 @@ ar5k_ar5211_detach(struct ath_hal *hal)
}
HAL_BOOL
+ar5k_ar5211_phy_disable(struct ath_hal *hal)
+{
+ AR5K_REG_WRITE(AR5K_AR5211_PHY_ACTIVE, AR5K_AR5211_PHY_DISABLE);
+ return (AH_TRUE);
+}
+
+HAL_BOOL
ar5k_ar5211_reset(struct ath_hal *hal, HAL_OPMODE op_mode, HAL_CHANNEL *channel,
HAL_BOOL change_channel, HAL_STATUS *status)
{
@@ -644,6 +667,18 @@ ar5k_ar5211_reset(struct ath_hal *hal, HAL_OPMODE op_mode, HAL_CHANNEL *channel,
}
void
+ar5k_ar5211_set_def_antenna(struct ath_hal *hal, u_int ant)
+{
+ AR5K_REG_WRITE(AR5K_AR5211_DEFAULT_ANTENNA, ant);
+}
+
+u_int
+ar5k_ar5211_get_def_antenna(struct ath_hal *hal)
+{
+ return AR5K_REG_READ(AR5K_AR5211_DEFAULT_ANTENNA);
+}
+
+void
ar5k_ar5211_set_opmode(struct ath_hal *hal)
{
u_int32_t pcu_reg, low_id, high_id;
@@ -822,6 +857,15 @@ ar5k_ar5211_setup_tx_queueprops(struct ath_hal *hal, int queue,
}
HAL_BOOL
+ar5k_ar5211_get_tx_queueprops(struct ath_hal *hal, int queue,
+ HAL_TXQ_INFO *queue_info)
+{
+ AR5K_ASSERT_ENTRY(queue, hal->ah_capabilities.cap_queues.q_tx_num);
+ bcopy(&hal->ah_txq[queue], queue_info, sizeof(HAL_TXQ_INFO));
+ return (AH_TRUE);
+}
+
+HAL_BOOL
ar5k_ar5211_release_tx_queue(struct ath_hal *hal, u_int queue)
{
AR5K_ASSERT_ENTRY(queue, hal->ah_capabilities.cap_queues.q_tx_num);
@@ -1037,6 +1081,13 @@ ar5k_ar5211_put_tx_buf(struct ath_hal *hal, u_int queue, u_int32_t phys_addr)
return (AH_TRUE);
}
+u_int32_t
+ar5k_ar5211_num_tx_pending(struct ath_hal *hal, u_int queue)
+{
+ AR5K_ASSERT_ENTRY(queue, hal->ah_capabilities.cap_queues.q_tx_num);
+ return (AR5K_AR5211_QCU_STS(queue) & AR5K_AR5211_QCU_STS_FRMPENDCNT);
+}
+
HAL_BOOL
ar5k_ar5211_tx_start(struct ath_hal *hal, u_int queue)
{
@@ -1639,6 +1690,13 @@ ar5k_ar5211_set_associd(struct ath_hal *hal, const u_int8_t *bssid,
}
HAL_BOOL
+ar5k_ar5211_set_bssid_mask(struct ath_hal *hal, const u_int8_t* mask)
+{
+ /* Not supported in 5211 */
+ return (AH_FALSE);
+}
+
+HAL_BOOL
ar5k_ar5211_set_gpio_output(struct ath_hal *hal, u_int32_t gpio)
{
if (gpio > AR5K_AR5211_NUM_GPIO)
@@ -2517,3 +2575,10 @@ ar5k_ar5211_rfregs(struct ath_hal *hal, HAL_CHANNEL *channel, u_int freq,
hal->ah_rf_gain = HAL_RFGAIN_INACTIVE;
}
+
+HAL_BOOL
+ar5k_ar5211_set_txpower_limit(struct ath_hal *hal, u_int power)
+{
+ /* Not implemented */
+ return (AH_FALSE);
+}