Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ed32e4f authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: remove struct ieee80211_if_init_conf



All its members (vif, mac_addr, type) are now available
in the vif struct directly, so we can pass that instead
of the conf struct. I generated this patch (except the
mac80211 and header file changes) with this semantic
patch:

@@
identifier conf, fn, hw;
type tp;
@@
tp fn(struct ieee80211_hw *hw,
-struct ieee80211_if_init_conf *conf)
+struct ieee80211_vif *vif)
{
<...
(
-conf->type
+vif->type
|
-conf->mac_addr
+vif->addr
|
-conf->vif
+vif
)
...>
}

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 98b62183
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -1400,15 +1400,15 @@ static void adm8211_configure_filter(struct ieee80211_hw *dev,
}
}


static int adm8211_add_interface(struct ieee80211_hw *dev,
static int adm8211_add_interface(struct ieee80211_hw *dev,
				 struct ieee80211_if_init_conf *conf)
				 struct ieee80211_vif *vif)
{
{
	struct adm8211_priv *priv = dev->priv;
	struct adm8211_priv *priv = dev->priv;
	if (priv->mode != NL80211_IFTYPE_MONITOR)
	if (priv->mode != NL80211_IFTYPE_MONITOR)
		return -EOPNOTSUPP;
		return -EOPNOTSUPP;


	switch (conf->type) {
	switch (vif->type) {
	case NL80211_IFTYPE_STATION:
	case NL80211_IFTYPE_STATION:
		priv->mode = conf->type;
		priv->mode = vif->type;
		break;
		break;
	default:
	default:
		return -EOPNOTSUPP;
		return -EOPNOTSUPP;
@@ -1416,8 +1416,8 @@ static int adm8211_add_interface(struct ieee80211_hw *dev,


	ADM8211_IDLE();
	ADM8211_IDLE();


	ADM8211_CSR_WRITE(PAR0, le32_to_cpu(*(__le32 *)conf->mac_addr));
	ADM8211_CSR_WRITE(PAR0, le32_to_cpu(*(__le32 *)vif->addr));
	ADM8211_CSR_WRITE(PAR1, le16_to_cpu(*(__le16 *)(conf->mac_addr + 4)));
	ADM8211_CSR_WRITE(PAR1, le16_to_cpu(*(__le16 *)(vif->addr + 4)));


	adm8211_update_mode(dev);
	adm8211_update_mode(dev);


@@ -1427,7 +1427,7 @@ static int adm8211_add_interface(struct ieee80211_hw *dev,
}
}


static void adm8211_remove_interface(struct ieee80211_hw *dev,
static void adm8211_remove_interface(struct ieee80211_hw *dev,
				     struct ieee80211_if_init_conf *conf)
				     struct ieee80211_vif *vif)
{
{
	struct adm8211_priv *priv = dev->priv;
	struct adm8211_priv *priv = dev->priv;
	priv->mode = NL80211_IFTYPE_MONITOR;
	priv->mode = NL80211_IFTYPE_MONITOR;
+3 −3
Original line number Original line Diff line number Diff line
@@ -1789,7 +1789,7 @@ static void at76_mac80211_stop(struct ieee80211_hw *hw)
}
}


static int at76_add_interface(struct ieee80211_hw *hw,
static int at76_add_interface(struct ieee80211_hw *hw,
			      struct ieee80211_if_init_conf *conf)
			      struct ieee80211_vif *vif)
{
{
	struct at76_priv *priv = hw->priv;
	struct at76_priv *priv = hw->priv;
	int ret = 0;
	int ret = 0;
@@ -1798,7 +1798,7 @@ static int at76_add_interface(struct ieee80211_hw *hw,


	mutex_lock(&priv->mtx);
	mutex_lock(&priv->mtx);


	switch (conf->type) {
	switch (vif->type) {
	case NL80211_IFTYPE_STATION:
	case NL80211_IFTYPE_STATION:
		priv->iw_mode = IW_MODE_INFRA;
		priv->iw_mode = IW_MODE_INFRA;
		break;
		break;
@@ -1814,7 +1814,7 @@ static int at76_add_interface(struct ieee80211_hw *hw,
}
}


static void at76_remove_interface(struct ieee80211_hw *hw,
static void at76_remove_interface(struct ieee80211_hw *hw,
				  struct ieee80211_if_init_conf *conf)
				  struct ieee80211_vif *vif)
{
{
	at76_dbg(DBG_MAC80211, "%s()", __func__);
	at76_dbg(DBG_MAC80211, "%s()", __func__);
}
}
+4 −4
Original line number Original line Diff line number Diff line
@@ -1939,7 +1939,7 @@ int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
}
}


static int ar9170_op_add_interface(struct ieee80211_hw *hw,
static int ar9170_op_add_interface(struct ieee80211_hw *hw,
				   struct ieee80211_if_init_conf *conf)
				   struct ieee80211_vif *vif)
{
{
	struct ar9170 *ar = hw->priv;
	struct ar9170 *ar = hw->priv;
	struct ath_common *common = &ar->common;
	struct ath_common *common = &ar->common;
@@ -1952,8 +1952,8 @@ static int ar9170_op_add_interface(struct ieee80211_hw *hw,
		goto unlock;
		goto unlock;
	}
	}


	ar->vif = conf->vif;
	ar->vif = vif;
	memcpy(common->macaddr, conf->mac_addr, ETH_ALEN);
	memcpy(common->macaddr, vif->addr, ETH_ALEN);


	if (modparam_nohwcrypt || (ar->vif->type != NL80211_IFTYPE_STATION)) {
	if (modparam_nohwcrypt || (ar->vif->type != NL80211_IFTYPE_STATION)) {
		ar->rx_software_decryption = true;
		ar->rx_software_decryption = true;
@@ -1973,7 +1973,7 @@ static int ar9170_op_add_interface(struct ieee80211_hw *hw,
}
}


static void ar9170_op_remove_interface(struct ieee80211_hw *hw,
static void ar9170_op_remove_interface(struct ieee80211_hw *hw,
				       struct ieee80211_if_init_conf *conf)
				       struct ieee80211_vif *vif)
{
{
	struct ar9170 *ar = hw->priv;
	struct ar9170 *ar = hw->priv;


+9 −9
Original line number Original line Diff line number Diff line
@@ -225,9 +225,9 @@ static int ath5k_reset_wake(struct ath5k_softc *sc);
static int ath5k_start(struct ieee80211_hw *hw);
static int ath5k_start(struct ieee80211_hw *hw);
static void ath5k_stop(struct ieee80211_hw *hw);
static void ath5k_stop(struct ieee80211_hw *hw);
static int ath5k_add_interface(struct ieee80211_hw *hw,
static int ath5k_add_interface(struct ieee80211_hw *hw,
		struct ieee80211_if_init_conf *conf);
		struct ieee80211_vif *vif);
static void ath5k_remove_interface(struct ieee80211_hw *hw,
static void ath5k_remove_interface(struct ieee80211_hw *hw,
		struct ieee80211_if_init_conf *conf);
		struct ieee80211_vif *vif);
static int ath5k_config(struct ieee80211_hw *hw, u32 changed);
static int ath5k_config(struct ieee80211_hw *hw, u32 changed);
static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw,
static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw,
				   int mc_count, struct dev_addr_list *mc_list);
				   int mc_count, struct dev_addr_list *mc_list);
@@ -2785,7 +2785,7 @@ static void ath5k_stop(struct ieee80211_hw *hw)
}
}


static int ath5k_add_interface(struct ieee80211_hw *hw,
static int ath5k_add_interface(struct ieee80211_hw *hw,
		struct ieee80211_if_init_conf *conf)
		struct ieee80211_vif *vif)
{
{
	struct ath5k_softc *sc = hw->priv;
	struct ath5k_softc *sc = hw->priv;
	int ret;
	int ret;
@@ -2796,22 +2796,22 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
		goto end;
		goto end;
	}
	}


	sc->vif = conf->vif;
	sc->vif = vif;


	switch (conf->type) {
	switch (vif->type) {
	case NL80211_IFTYPE_AP:
	case NL80211_IFTYPE_AP:
	case NL80211_IFTYPE_STATION:
	case NL80211_IFTYPE_STATION:
	case NL80211_IFTYPE_ADHOC:
	case NL80211_IFTYPE_ADHOC:
	case NL80211_IFTYPE_MESH_POINT:
	case NL80211_IFTYPE_MESH_POINT:
	case NL80211_IFTYPE_MONITOR:
	case NL80211_IFTYPE_MONITOR:
		sc->opmode = conf->type;
		sc->opmode = vif->type;
		break;
		break;
	default:
	default:
		ret = -EOPNOTSUPP;
		ret = -EOPNOTSUPP;
		goto end;
		goto end;
	}
	}


	ath5k_hw_set_lladdr(sc->ah, conf->mac_addr);
	ath5k_hw_set_lladdr(sc->ah, vif->addr);
	ath5k_mode_setup(sc);
	ath5k_mode_setup(sc);


	ret = 0;
	ret = 0;
@@ -2822,13 +2822,13 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,


static void
static void
ath5k_remove_interface(struct ieee80211_hw *hw,
ath5k_remove_interface(struct ieee80211_hw *hw,
			struct ieee80211_if_init_conf *conf)
			struct ieee80211_vif *vif)
{
{
	struct ath5k_softc *sc = hw->priv;
	struct ath5k_softc *sc = hw->priv;
	u8 mac[ETH_ALEN] = {};
	u8 mac[ETH_ALEN] = {};


	mutex_lock(&sc->lock);
	mutex_lock(&sc->lock);
	if (sc->vif != conf->vif)
	if (sc->vif != vif)
		goto end;
		goto end;


	ath5k_hw_set_lladdr(sc->ah, mac);
	ath5k_hw_set_lladdr(sc->ah, mac);
+14 −14
Original line number Original line Diff line number Diff line
@@ -2534,12 +2534,12 @@ static void ath9k_stop(struct ieee80211_hw *hw)
}
}


static int ath9k_add_interface(struct ieee80211_hw *hw,
static int ath9k_add_interface(struct ieee80211_hw *hw,
			       struct ieee80211_if_init_conf *conf)
			       struct ieee80211_vif *vif)
{
{
	struct ath_wiphy *aphy = hw->priv;
	struct ath_wiphy *aphy = hw->priv;
	struct ath_softc *sc = aphy->sc;
	struct ath_softc *sc = aphy->sc;
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct ath_vif *avp = (void *)conf->vif->drv_priv;
	struct ath_vif *avp = (void *)vif->drv_priv;
	enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED;
	enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED;
	int ret = 0;
	int ret = 0;


@@ -2551,7 +2551,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
		goto out;
		goto out;
	}
	}


	switch (conf->type) {
	switch (vif->type) {
	case NL80211_IFTYPE_STATION:
	case NL80211_IFTYPE_STATION:
		ic_opmode = NL80211_IFTYPE_STATION;
		ic_opmode = NL80211_IFTYPE_STATION;
		break;
		break;
@@ -2562,11 +2562,11 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
			ret = -ENOBUFS;
			ret = -ENOBUFS;
			goto out;
			goto out;
		}
		}
		ic_opmode = conf->type;
		ic_opmode = vif->type;
		break;
		break;
	default:
	default:
		ath_print(common, ATH_DBG_FATAL,
		ath_print(common, ATH_DBG_FATAL,
			"Interface type %d not yet supported\n", conf->type);
			"Interface type %d not yet supported\n", vif->type);
		ret = -EOPNOTSUPP;
		ret = -EOPNOTSUPP;
		goto out;
		goto out;
	}
	}
@@ -2598,18 +2598,18 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
	 * Enable MIB interrupts when there are hardware phy counters.
	 * Enable MIB interrupts when there are hardware phy counters.
	 * Note we only do this (at the moment) for station mode.
	 * Note we only do this (at the moment) for station mode.
	 */
	 */
	if ((conf->type == NL80211_IFTYPE_STATION) ||
	if ((vif->type == NL80211_IFTYPE_STATION) ||
	    (conf->type == NL80211_IFTYPE_ADHOC) ||
	    (vif->type == NL80211_IFTYPE_ADHOC) ||
	    (conf->type == NL80211_IFTYPE_MESH_POINT)) {
	    (vif->type == NL80211_IFTYPE_MESH_POINT)) {
		sc->imask |= ATH9K_INT_MIB;
		sc->imask |= ATH9K_INT_MIB;
		sc->imask |= ATH9K_INT_TSFOOR;
		sc->imask |= ATH9K_INT_TSFOOR;
	}
	}


	ath9k_hw_set_interrupts(sc->sc_ah, sc->imask);
	ath9k_hw_set_interrupts(sc->sc_ah, sc->imask);


	if (conf->type == NL80211_IFTYPE_AP    ||
	if (vif->type == NL80211_IFTYPE_AP    ||
	    conf->type == NL80211_IFTYPE_ADHOC ||
	    vif->type == NL80211_IFTYPE_ADHOC ||
	    conf->type == NL80211_IFTYPE_MONITOR)
	    vif->type == NL80211_IFTYPE_MONITOR)
		ath_start_ani(common);
		ath_start_ani(common);


out:
out:
@@ -2618,12 +2618,12 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
}
}


static void ath9k_remove_interface(struct ieee80211_hw *hw,
static void ath9k_remove_interface(struct ieee80211_hw *hw,
				   struct ieee80211_if_init_conf *conf)
				   struct ieee80211_vif *vif)
{
{
	struct ath_wiphy *aphy = hw->priv;
	struct ath_wiphy *aphy = hw->priv;
	struct ath_softc *sc = aphy->sc;
	struct ath_softc *sc = aphy->sc;
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct ath_vif *avp = (void *)conf->vif->drv_priv;
	struct ath_vif *avp = (void *)vif->drv_priv;
	int i;
	int i;


	ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n");
	ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n");
@@ -2644,7 +2644,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
	sc->sc_flags &= ~SC_OP_BEACONS;
	sc->sc_flags &= ~SC_OP_BEACONS;


	for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) {
	for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) {
		if (sc->beacon.bslot[i] == conf->vif) {
		if (sc->beacon.bslot[i] == vif) {
			printk(KERN_DEBUG "%s: vif had allocated beacon "
			printk(KERN_DEBUG "%s: vif had allocated beacon "
			       "slot\n", __func__);
			       "slot\n", __func__);
			sc->beacon.bslot[i] = NULL;
			sc->beacon.bslot[i] = NULL;
Loading