瀏覽代碼

mac802154: remove unneeded vif struct

This patch removes the virtual interface structure from sub if data
struct, because it isn't used anywhere. This structure could be useful
for give per interface information at softmac driver layer. Nevertheless
there exist no use case currently and it contains the interface type
information currently. This information is also stored inside wpan dev
which is now used to check on the wpan dev interface type.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Varka Bhadram <varkabhadram@gmail.com>
Acked-by: Varka Bhadram <varkabhadram@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Alexander Aring 10 年之前
父節點
當前提交
ed65963ba0

+ 0 - 1
drivers/net/ieee802154/at86rf230.c

@@ -1602,7 +1602,6 @@ static int at86rf230_probe(struct spi_device *spi)
 	lp->spi = spi;
 	lp->spi = spi;
 	lp->slp_tr = slp_tr;
 	lp->slp_tr = slp_tr;
 	hw->parent = &spi->dev;
 	hw->parent = &spi->dev;
-	hw->vif_data_size = sizeof(*lp);
 	ieee802154_random_extended_addr(&hw->phy->perm_extended_addr);
 	ieee802154_random_extended_addr(&hw->phy->perm_extended_addr);
 
 
 	lp->regmap = devm_regmap_init_spi(spi, &at86rf230_regmap_spi_config);
 	lp->regmap = devm_regmap_init_spi(spi, &at86rf230_regmap_spi_config);

+ 0 - 1
drivers/net/ieee802154/cc2520.c

@@ -742,7 +742,6 @@ static int cc2520_register(struct cc2520_private *priv)
 	priv->hw->priv = priv;
 	priv->hw->priv = priv;
 	priv->hw->parent = &priv->spi->dev;
 	priv->hw->parent = &priv->spi->dev;
 	priv->hw->extra_tx_headroom = 0;
 	priv->hw->extra_tx_headroom = 0;
-	priv->hw->vif_data_size = sizeof(*priv);
 	ieee802154_random_extended_addr(&priv->hw->phy->perm_extended_addr);
 	ieee802154_random_extended_addr(&priv->hw->phy->perm_extended_addr);
 
 
 	/* We do support only 2.4 Ghz */
 	/* We do support only 2.4 Ghz */

+ 0 - 8
include/net/mac802154.h

@@ -56,13 +56,6 @@ struct ieee802154_hw_addr_filt {
 	u8	pan_coord;
 	u8	pan_coord;
 };
 };
 
 
-struct ieee802154_vif {
-	int type;
-
-	/* must be last */
-	u8 drv_priv[0] __aligned(sizeof(void *));
-};
-
 struct ieee802154_hw {
 struct ieee802154_hw {
 	/* filled by the driver */
 	/* filled by the driver */
 	int	extra_tx_headroom;
 	int	extra_tx_headroom;
@@ -73,7 +66,6 @@ struct ieee802154_hw {
 	struct	ieee802154_hw_addr_filt hw_filt;
 	struct	ieee802154_hw_addr_filt hw_filt;
 	void	*priv;
 	void	*priv;
 	struct	wpan_phy *phy;
 	struct	wpan_phy *phy;
-	size_t vif_data_size;
 };
 };
 
 
 /* Checksum is in hardware and is omitted from a packet
 /* Checksum is in hardware and is omitted from a packet

+ 0 - 2
net/mac802154/ieee802154_i.h

@@ -92,8 +92,6 @@ struct ieee802154_sub_if_data {
 	struct mutex sec_mtx;
 	struct mutex sec_mtx;
 
 
 	struct mac802154_llsec sec;
 	struct mac802154_llsec sec;
-	/* must be last, dynamically sized area in this! */
-	struct ieee802154_vif vif;
 };
 };
 
 
 #define MAC802154_CHAN_NONE		0xff /* No channel is assigned */
 #define MAC802154_CHAN_NONE		0xff /* No channel is assigned */

+ 4 - 5
net/mac802154/iface.c

@@ -219,8 +219,8 @@ ieee802154_check_concurrent_iface(struct ieee802154_sub_if_data *sdata,
 			 * exist really an use case if we need to support
 			 * exist really an use case if we need to support
 			 * multiple node types at the same time.
 			 * multiple node types at the same time.
 			 */
 			 */
-			if (sdata->vif.type == NL802154_IFTYPE_NODE &&
-			    nsdata->vif.type == NL802154_IFTYPE_NODE)
+			if (wpan_dev->iftype == NL802154_IFTYPE_NODE &&
+			    nsdata->wpan_dev.iftype == NL802154_IFTYPE_NODE)
 				return -EBUSY;
 				return -EBUSY;
 
 
 			/* check all phy mac sublayer settings are the same.
 			/* check all phy mac sublayer settings are the same.
@@ -243,7 +243,7 @@ static int mac802154_wpan_open(struct net_device *dev)
 	struct ieee802154_local *local = sdata->local;
 	struct ieee802154_local *local = sdata->local;
 	struct wpan_dev *wpan_dev = &sdata->wpan_dev;
 	struct wpan_dev *wpan_dev = &sdata->wpan_dev;
 
 
-	rc = ieee802154_check_concurrent_iface(sdata, sdata->vif.type);
+	rc = ieee802154_check_concurrent_iface(sdata, wpan_dev->iftype);
 	if (rc < 0)
 	if (rc < 0)
 		return rc;
 		return rc;
 
 
@@ -467,7 +467,6 @@ ieee802154_setup_sdata(struct ieee802154_sub_if_data *sdata,
 	u8 tmp;
 	u8 tmp;
 
 
 	/* set some type-dependent values */
 	/* set some type-dependent values */
-	sdata->vif.type = type;
 	sdata->wpan_dev.iftype = type;
 	sdata->wpan_dev.iftype = type;
 
 
 	get_random_bytes(&tmp, sizeof(tmp));
 	get_random_bytes(&tmp, sizeof(tmp));
@@ -523,7 +522,7 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
 
 
 	ASSERT_RTNL();
 	ASSERT_RTNL();
 
 
-	ndev = alloc_netdev(sizeof(*sdata) + local->hw.vif_data_size, name,
+	ndev = alloc_netdev(sizeof(*sdata), name,
 			    name_assign_type, ieee802154_if_setup);
 			    name_assign_type, ieee802154_if_setup);
 	if (!ndev)
 	if (!ndev)
 		return ERR_PTR(-ENOMEM);
 		return ERR_PTR(-ENOMEM);

+ 2 - 2
net/mac802154/rx.c

@@ -202,7 +202,7 @@ __ieee802154_rx_handle_packet(struct ieee802154_local *local,
 	}
 	}
 
 
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-		if (sdata->vif.type != NL802154_IFTYPE_NODE ||
+		if (sdata->wpan_dev.iftype != NL802154_IFTYPE_NODE ||
 		    !netif_running(sdata->dev))
 		    !netif_running(sdata->dev))
 			continue;
 			continue;
 
 
@@ -227,7 +227,7 @@ ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb)
 	skb->protocol = htons(ETH_P_IEEE802154);
 	skb->protocol = htons(ETH_P_IEEE802154);
 
 
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-		if (sdata->vif.type != NL802154_IFTYPE_MONITOR)
+		if (sdata->wpan_dev.iftype != NL802154_IFTYPE_MONITOR)
 			continue;
 			continue;
 
 
 		if (!ieee802154_sdata_running(sdata))
 		if (!ieee802154_sdata_running(sdata))