From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Golle Date: Wed, 2 Nov 2011 19:16:18 +0100 Subject: [ath9k-devel] RFC: expose antCtrlCommon aka. AR_PHY_SWITCH_COM via nl80211 In-Reply-To: <4EB1835B.2010704@openwrt.org> References: <4EB17A67.1030109@allnet.de> <4EB18291.1000906@allnet.de> <4EB1835B.2010704@openwrt.org> Message-ID: <4EB188F2.7060509@allnet.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On 11/02/2011 06:52 PM, Felix Fietkau wrote: >> I don't know the exact electronic details of the implementation, so I'd go with >> a list of known-to-be-good values (passed to the driver via platform-data) >> instead of a causal check (e.g. don't allow to set the TX and RX to the same >> antenna or whatever you imagine to possibly be an invalid setting). > I think passing such 'magic' values from user space to the driver is a > bad idea. The abstraction should happen within the driver and exposed > via the antenna control API. I agree that this should be abstracted away from the user. You reckon the user should set the values via iw phy phy0 set antenna 1 2 -> set (0x09a0,0x0210) and iw phy phy0 set antenna 2 1 -> set (0x0a90,0x0120) and let the driver know that only (1,2) and (2,1) are valid settings? it'd be nice to (additionally?) implement iw phy phy0 set antenna horizontal i would then imagine something like struct ath9k_platform_switchcom_profile { char *name; u16 tx_antenna; u16 rx_antenna; } and extend ath9k_platform_data by u8 um_switchcom_profiles; ath9k_platform_switchcom_profile *profiles; As available_anntenas_rx and available_anntenas_tx are just bitmasks for now, this first of all requires a way to handle the information about available antenna-combinations in struct wiphy. (right?) Cheers Daniel