Skip to contentSkip to conversation

p54: move p54_vdcf_init to the right place.

PATCH New Christian Lamparter 1 participant 1 message Aug 13, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 p54: move p54_vdcf_init to the right place.

priv->tx_hdr_len is set by the driver _after_ it called p54_init_common. While this isn't much a problem for any PCI or ISL3887 cards/sticks, because they don't need any extra header and therefore tx_hdr_len is zero for them...

---

Larry, do you have any comments?
Because this series will eventually go to [email protected] too...

---

drivers/net/wireless/p54/p54common.c +11 -9
diff -Nurp a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
@@ -834,10 +834,21 @@ static int p54_start(struct ieee80211_hw
 	struct p54_common *priv = dev->priv;
 	int err;
 
+	if (!priv->cached_vdcf) {
+		priv->cached_vdcf = kzalloc(sizeof(struct p54_tx_control_vdcf)+
+			priv->tx_hdr_len + sizeof(struct p54_control_hdr),
+			GFP_KERNEL);
+
+		if (!priv->cached_vdcf)
+			return -ENOMEM;
+	}
+
 	err = priv->open(dev);
 	if (!err)
 		priv->mode = IEEE80211_IF_TYPE_MNTR;
 
+	p54_init_vdcf(dev);
+
 	return err;
 }
 
@@ -1017,15 +1028,6 @@ struct ieee80211_hw *p54_init_common(siz
 	dev->extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 +
 				 sizeof(struct p54_tx_control_allocdata);
 
-        priv->cached_vdcf = kzalloc(sizeof(struct p54_tx_control_vdcf) +
-              priv->tx_hdr_len + sizeof(struct p54_control_hdr), GFP_KERNEL);
-
-	if (!priv->cached_vdcf) {
-		ieee80211_free_hw(dev);
-		return NULL;
-	}
-
-	p54_init_vdcf(dev);
 	mutex_init(&priv->conf_mutex);
 
 	return dev;