Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ath9k_htc: increase number of configurable virtual interfaces #574

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/x86/include/asm/apicdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* This is the IO-APIC register space as specified
* by Intel docs:
*/
#define IO_APIC_SLOT_SIZE 1024
#define IO_APIC_SLOT_SIZE 68

#define APIC_ID 0x20

Expand Down
11 changes: 9 additions & 2 deletions drivers/gpu/drm/radeon/atombios_encoders.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ atombios_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 level)

static u8 radeon_atom_bl_level(struct backlight_device *bd)
{
struct radeon_backlight_privdata *pdata = bl_get_data(bd);
u8 level;

/* Convert brightness to hardware level */
Expand All @@ -150,6 +151,9 @@ static u8 radeon_atom_bl_level(struct backlight_device *bd)
else
level = bd->props.brightness;

if (pdata->negative)
level = RADEON_MAX_BL_LEVEL - level;

return level;
}

Expand All @@ -169,8 +173,11 @@ static int radeon_atom_backlight_get_brightness(struct backlight_device *bd)
struct radeon_encoder *radeon_encoder = pdata->encoder;
struct drm_device *dev = radeon_encoder->base.dev;
struct radeon_device *rdev = dev->dev_private;
u8 backlight_level;

return radeon_atom_get_backlight_level_from_reg(rdev);
backlight_level = radeon_atom_get_backlight_level_from_reg(rdev);

return pdata->negative ? RADEON_MAX_BL_LEVEL - backlight_level : backlight_level;
}

static const struct backlight_ops radeon_atom_backlight_ops = {
Expand Down Expand Up @@ -212,7 +219,7 @@ void radeon_atom_backlight_init(struct radeon_encoder *radeon_encoder,
}

memset(&props, 0, sizeof(props));
props.max_brightness = RADEON_MAX_BL_LEVEL;
props.max_brightness = pdata->negative ? RADEON_MAX_BL_LEVEL - 1 : RADEON_MAX_BL_LEVEL;
props.type = BACKLIGHT_RAW;
snprintf(bl_name, sizeof(bl_name),
"radeon_bl%d", dev->primary->index);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ struct ath_common {
int debug_mask;
enum ath_device_state state;
unsigned long op_flags;
u32 chan_bw;

struct ath_ani ani;

Expand Down
30 changes: 30 additions & 0 deletions drivers/net/wireless/ath/ath9k/common-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,33 @@ void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
&fops_phy_err);
}
EXPORT_SYMBOL(ath9k_cmn_debug_phy_err);

#ifdef CONFIG_ATH9K_DYNACK
static ssize_t read_file_ackto(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_hw *ah = file->private_data;
char buf[32];
unsigned int len;

len = sprintf(buf, "%u %c\n", ah->dynack.ackto,
(ah->dynack.enabled) ? 'A' : 'S');

return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

static const struct file_operations fops_ackto = {
.read = read_file_ackto,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};

void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy,
struct ath_hw *ah)
{
debugfs_create_file("ack_to", 0400, debugfs_phy, ah, &fops_ackto);
}
EXPORT_SYMBOL(ath9k_cmn_debug_ack_to);

#endif
6 changes: 6 additions & 0 deletions drivers/net/wireless/ath/ath9k/common-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
struct ath_rx_stats *rxstats);
void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
struct ath_rx_stats *rxstats);
void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy,
struct ath_hw *ah);
#else
static inline void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
struct ath_hw *ah)
Expand All @@ -96,4 +98,8 @@ static inline void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
struct ath_rx_stats *rxstats)
{
}
static inline void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy,
struct ath_hw *ah);
{
}
#endif /* CONFIG_ATH9K_COMMON_DEBUG */
21 changes: 18 additions & 3 deletions drivers/net/wireless/ath/ath9k/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,19 +297,33 @@ EXPORT_SYMBOL(ath9k_cmn_get_hw_crypto_keytype);
/*
* Update internal channel flags.
*/
static void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan,
static void ath9k_cmn_update_ichannel(struct ath_common *common,
struct ath9k_channel *ichan,
struct cfg80211_chan_def *chandef)
{
struct ieee80211_channel *chan = chandef->chan;
u16 flags = 0;
int width;

ichan->channel = chan->center_freq;
ichan->chan = chan;

if (chan->band == NL80211_BAND_5GHZ)
flags |= CHANNEL_5GHZ;

switch (chandef->width) {
switch (common->chan_bw) {
case 5:
width = NL80211_CHAN_WIDTH_5;
break;
case 10:
width = NL80211_CHAN_WIDTH_10;
break;
default:
width = chandef->width;
break;
}

switch (width) {
case NL80211_CHAN_WIDTH_5:
flags |= CHANNEL_QUARTER;
break;
Expand Down Expand Up @@ -342,10 +356,11 @@ struct ath9k_channel *ath9k_cmn_get_channel(struct ieee80211_hw *hw,
struct cfg80211_chan_def *chandef)
{
struct ieee80211_channel *curchan = chandef->chan;
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_channel *channel;

channel = &ah->channels[curchan->hw_value];
ath9k_cmn_update_ichannel(channel, chandef);
ath9k_cmn_update_ichannel(common, channel, chandef);

return channel;
}
Expand Down
71 changes: 46 additions & 25 deletions drivers/net/wireless/ath/ath9k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1038,29 +1038,6 @@ static const struct file_operations fops_btcoex = {
};
#endif

#ifdef CONFIG_ATH9K_DYNACK
static ssize_t read_file_ackto(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;
struct ath_hw *ah = sc->sc_ah;
char buf[32];
unsigned int len;

len = sprintf(buf, "%u %c\n", ah->dynack.ackto,
(ah->dynack.enabled) ? 'A' : 'S');

return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

static const struct file_operations fops_ackto = {
.read = read_file_ackto,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};
#endif

#ifdef CONFIG_ATH9K_WOW

static ssize_t read_file_wow(struct file *file, char __user *user_buf,
Expand Down Expand Up @@ -1374,6 +1351,50 @@ void ath9k_deinit_debug(struct ath_softc *sc)
ath9k_cmn_spectral_deinit_debug(&sc->spec_priv);
}

static ssize_t read_file_chan_bw(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
char buf[32];
unsigned int len;

len = sprintf(buf, "0x%08x\n", common->chan_bw);
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

static ssize_t write_file_chan_bw(struct file *file, const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
unsigned long chan_bw;
char buf[32];
ssize_t len;

len = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, len))
return -EFAULT;

buf[len] = '\0';
if (kstrtoul(buf, 0, &chan_bw))
return -EINVAL;

common->chan_bw = chan_bw;
if (!test_bit(ATH_OP_INVALID, &common->op_flags))
ath9k_ops.config(sc->hw, IEEE80211_CONF_CHANGE_CHANNEL);

return count;
}

static const struct file_operations fops_chanbw = {
.read = read_file_chan_bw,
.write = write_file_chan_bw,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};

int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
Expand Down Expand Up @@ -1451,9 +1472,9 @@ int ath9k_init_debug(struct ath_hw *ah)
#endif

#ifdef CONFIG_ATH9K_DYNACK
debugfs_create_file("ack_to", 0400, sc->debug.debugfs_phy,
sc, &fops_ackto);
ath9k_cmn_debug_ack_to(sc->debug.debugfs_phy, sc->sc_ah);
#endif

debugfs_create_file("tpc", 0600, sc->debug.debugfs_phy, sc, &fops_tpc);

debugfs_create_u16("airtime_flags", 0600,
Expand Down
9 changes: 5 additions & 4 deletions drivers/net/wireless/ath/ath9k/htc.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ struct ath9k_htc_target_rx_stats {
__be32 host_done;
} __packed;

#define ATH9K_HTC_MAX_VIF 2
#define ATH9K_HTC_MAX_BCN_VIF 2
#define ATH9K_HTC_MAX_VIF 8
#define ATH9K_HTC_MAX_BCN_VIF 8

#define INC_VIF(_priv, _type) do { \
switch (_type) { \
Expand Down Expand Up @@ -251,8 +251,8 @@ struct ath9k_vif_iter_data {
u8 mask[ETH_ALEN];
};

#define ATH9K_HTC_MAX_STA 8
#define ATH9K_HTC_MAX_TID 8
#define ATH9K_HTC_MAX_STA 128
#define ATH9K_HTC_MAX_TID 16

enum tid_aggr_state {
AGGR_STOP = 0,
Expand Down Expand Up @@ -564,6 +564,7 @@ void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv,
u8 enable_coex);
void ath9k_htc_ani_work(struct work_struct *work);
void ath9k_htc_check_ani(struct ath9k_htc_priv *priv);
void ath9k_htc_start_ani(struct ath9k_htc_priv *priv);
void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv);

Expand Down
Loading