Skip to content

Commit

Permalink
mt76x0: remove mt76x0_set_country_reg routine
Browse files Browse the repository at this point in the history
Remove mt76x0_set_country_reg routine for the moment
since it is partial and it is not actually used

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
Lorenzo Bianconi authored and Felix Fietkau committed Oct 1, 2018
1 parent 443569a commit 1137847
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 42 deletions.
2 changes: 0 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ mt76x0_eeprom_param_read(struct seq_file *file, void *data)
val = mt76x02_eeprom_get(&dev->mt76, MT_EE_NIC_CONF_0);
seq_printf(file, "Power Amplifier type %lx\n",
val & MT_EE_NIC_CONF_0_PA_TYPE);
seq_printf(file, "Reg channels: %hhu-%hhu\n", dev->ee->reg.start,
dev->ee->reg.start + dev->ee->reg.num - 1);

seq_puts(file, "Per channel power:\n");
for (i = 0; i < 58; i++)
Expand Down
38 changes: 0 additions & 38 deletions drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,43 +103,6 @@ mt76x0_set_temp_offset(struct mt76x0_dev *dev, u8 *eeprom)
dev->ee->temp_off = -10;
}

static void
mt76x0_set_country_reg(struct mt76x0_dev *dev, u8 *eeprom)
{
/* Note: - region 31 is not valid for mt76x0 (see rtmp_init.c)
* - comments in rtmp_def.h are incorrect (see rt_channel.c)
*/
static const struct reg_channel_bounds chan_bounds[] = {
/* EEPROM country regions 0 - 7 */
{ 1, 11 }, { 1, 13 }, { 10, 2 }, { 10, 4 },
{ 14, 1 }, { 1, 14 }, { 3, 7 }, { 5, 9 },
/* EEPROM country regions 32 - 33 */
{ 1, 11 }, { 1, 14 }
};
u8 val = eeprom[MT_EE_COUNTRY_REGION_2GHZ];
int idx = -1;

dev_dbg(dev->mt76.dev, "REG 2GHZ %u REG 5GHZ %u\n", val, eeprom[MT_EE_COUNTRY_REGION_5GHZ]);
if (val < 8)
idx = val;
if (val > 31 && val < 33)
idx = val - 32 + 8;

if (idx != -1)
dev_info(dev->mt76.dev,
"EEPROM country region %02hhx (channels %hhd-%hhd)\n",
val, chan_bounds[idx].start,
chan_bounds[idx].start + chan_bounds[idx].num - 1);
else
idx = 5; /* channels 1 - 14 */

dev->ee->reg = chan_bounds[idx];

/* TODO: country region 33 is special - phy should be set to B-mode
* before entering channel 14 (see sta/connect.c)
*/
}

static void
mt76x0_set_rf_freq_off(struct mt76x0_dev *dev, u8 *eeprom)
{
Expand Down Expand Up @@ -353,7 +316,6 @@ mt76x0_eeprom_init(struct mt76x0_dev *dev)

mt76x02_mac_setaddr(&dev->mt76, eeprom + MT_EE_MAC_ADDR);
mt76x0_set_chip_cap(dev, eeprom);
mt76x0_set_country_reg(dev, eeprom);
mt76x0_set_rf_freq_off(dev, eeprom);
mt76x0_set_temp_offset(dev, eeprom);
mt76x0_set_lna_gain(dev, eeprom);
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ struct mt76x0_eeprom_params {
u32 tx_pwr_cfg_5g[5][2];

u8 tx_pwr_per_chan[58];

struct reg_channel_bounds reg;
};

int mt76x0_eeprom_init(struct mt76x0_dev *dev);
Expand Down

0 comments on commit 1137847

Please sign in to comment.