diff options
author | Holger Schurig <holgerschurig@googlemail.com> | 2009-12-02 09:25:56 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-22 13:37:12 -0500 |
commit | c24ef46e6b1597e54f185e0b48eb9073ef155a8c (patch) | |
tree | 59cf594556b9ae291580163b0870750aefbf1b22 /drivers/net/wireless/libertas/mesh.c | |
parent | 5d1ec85f00e999dba61bdcbd959d62439d418e56 (diff) |
libertas: use priv->mesh_tlv instead of priv->mesh_fw_ver
Both variables contained the same information (no mesh, old mesh, new mesh).
So we can get rid of one variable.
Also move the mesh-version test from cmd.c into mesh.c.
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/mesh.c')
-rw-r--r-- | drivers/net/wireless/libertas/mesh.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/net/wireless/libertas/mesh.c b/drivers/net/wireless/libertas/mesh.c index 2f91c9b808af..1d94f7d4efc8 100644 --- a/drivers/net/wireless/libertas/mesh.c +++ b/drivers/net/wireless/libertas/mesh.c | |||
@@ -196,7 +196,12 @@ int lbs_init_mesh(struct lbs_private *priv) | |||
196 | 196 | ||
197 | lbs_deb_enter(LBS_DEB_MESH); | 197 | lbs_deb_enter(LBS_DEB_MESH); |
198 | 198 | ||
199 | if (priv->mesh_fw_ver == MESH_FW_OLD) { | 199 | /* Determine mesh_fw_ver from fwrelease and fwcapinfo */ |
200 | /* 5.0.16p0 9.0.0.p0 is known to NOT support any mesh */ | ||
201 | /* 5.110.22 have mesh command with 0xa3 command id */ | ||
202 | /* 10.0.0.p0 FW brings in mesh config command with different id */ | ||
203 | /* Check FW version MSB and initialize mesh_fw_ver */ | ||
204 | if (MRVL_FW_MAJOR_REV(priv->fwrelease) == MRVL_FW_V5) { | ||
200 | /* Enable mesh, if supported, and work out which TLV it uses. | 205 | /* Enable mesh, if supported, and work out which TLV it uses. |
201 | 0x100 + 291 is an unofficial value used in 5.110.20.pXX | 206 | 0x100 + 291 is an unofficial value used in 5.110.20.pXX |
202 | 0x100 + 37 is the official value used in 5.110.21.pXX | 207 | 0x100 + 37 is the official value used in 5.110.21.pXX |
@@ -218,7 +223,9 @@ int lbs_init_mesh(struct lbs_private *priv) | |||
218 | priv->channel)) | 223 | priv->channel)) |
219 | priv->mesh_tlv = 0; | 224 | priv->mesh_tlv = 0; |
220 | } | 225 | } |
221 | } else if (priv->mesh_fw_ver == MESH_FW_NEW) { | 226 | } else |
227 | if ((MRVL_FW_MAJOR_REV(priv->fwrelease) >= MRVL_FW_V10) && | ||
228 | (priv->fwcapinfo & MESH_CAPINFO_ENABLE_MASK)) { | ||
222 | /* 10.0.0.pXX new firmwares should succeed with TLV | 229 | /* 10.0.0.pXX new firmwares should succeed with TLV |
223 | * 0x100+37; Do not invoke command with old TLV. | 230 | * 0x100+37; Do not invoke command with old TLV. |
224 | */ | 231 | */ |
@@ -227,6 +234,8 @@ int lbs_init_mesh(struct lbs_private *priv) | |||
227 | priv->channel)) | 234 | priv->channel)) |
228 | priv->mesh_tlv = 0; | 235 | priv->mesh_tlv = 0; |
229 | } | 236 | } |
237 | |||
238 | |||
230 | if (priv->mesh_tlv) { | 239 | if (priv->mesh_tlv) { |
231 | lbs_add_mesh(priv); | 240 | lbs_add_mesh(priv); |
232 | 241 | ||
@@ -416,10 +425,10 @@ struct net_device *lbs_mesh_set_dev(struct lbs_private *priv, | |||
416 | struct net_device *dev, struct rxpd *rxpd) | 425 | struct net_device *dev, struct rxpd *rxpd) |
417 | { | 426 | { |
418 | if (priv->mesh_dev) { | 427 | if (priv->mesh_dev) { |
419 | if (priv->mesh_fw_ver == MESH_FW_OLD) { | 428 | if (priv->mesh_tlv == TLV_TYPE_OLD_MESH_ID) { |
420 | if (rxpd->rx_control & RxPD_MESH_FRAME) | 429 | if (rxpd->rx_control & RxPD_MESH_FRAME) |
421 | dev = priv->mesh_dev; | 430 | dev = priv->mesh_dev; |
422 | } else if (priv->mesh_fw_ver == MESH_FW_NEW) { | 431 | } else if (priv->mesh_tlv == TLV_TYPE_MESH_ID) { |
423 | if (rxpd->u.bss.bss_num == MESH_IFACE_ID) | 432 | if (rxpd->u.bss.bss_num == MESH_IFACE_ID) |
424 | dev = priv->mesh_dev; | 433 | dev = priv->mesh_dev; |
425 | } | 434 | } |
@@ -432,9 +441,9 @@ void lbs_mesh_set_txpd(struct lbs_private *priv, | |||
432 | struct net_device *dev, struct txpd *txpd) | 441 | struct net_device *dev, struct txpd *txpd) |
433 | { | 442 | { |
434 | if (dev == priv->mesh_dev) { | 443 | if (dev == priv->mesh_dev) { |
435 | if (priv->mesh_fw_ver == MESH_FW_OLD) | 444 | if (priv->mesh_tlv == TLV_TYPE_OLD_MESH_ID) |
436 | txpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME); | 445 | txpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME); |
437 | else if (priv->mesh_fw_ver == MESH_FW_NEW) | 446 | else if (priv->mesh_tlv == TLV_TYPE_MESH_ID) |
438 | txpd->u.bss.bss_num = MESH_IFACE_ID; | 447 | txpd->u.bss.bss_num = MESH_IFACE_ID; |
439 | } | 448 | } |
440 | } | 449 | } |
@@ -538,7 +547,7 @@ static int __lbs_mesh_config_send(struct lbs_private *priv, | |||
538 | * Command id is 0xac for v10 FW along with mesh interface | 547 | * Command id is 0xac for v10 FW along with mesh interface |
539 | * id in bits 14-13-12. | 548 | * id in bits 14-13-12. |
540 | */ | 549 | */ |
541 | if (priv->mesh_fw_ver == MESH_FW_NEW) | 550 | if (priv->mesh_tlv == TLV_TYPE_MESH_ID) |
542 | command = CMD_MESH_CONFIG | | 551 | command = CMD_MESH_CONFIG | |
543 | (MESH_IFACE_ID << MESH_IFACE_BIT_OFFSET); | 552 | (MESH_IFACE_ID << MESH_IFACE_BIT_OFFSET); |
544 | 553 | ||