1574 (TInt)aWlanInfo.iSecurityMode, |
1577 (TInt)aWlanInfo.iSecurityMode, |
1575 (TInt)aWlanInfo.UsesPreSharedKey() ); |
1578 (TInt)aWlanInfo.UsesPreSharedKey() ); |
1576 } |
1579 } |
1577 |
1580 |
1578 |
1581 |
1579 // --------------------------------------------------------------------------- |
1582 // ----------------------------------------------------------------------------- |
1580 // CWsfWlanScanner::RefreshMaxRate |
1583 // CWsfWlanScanner::ConvertTxRateToTxRateEnum |
1581 // --------------------------------------------------------------------------- |
1584 // ----------------------------------------------------------------------------- |
1582 // |
1585 // |
1583 void CWsfWlanScanner::RefreshMaxRate( TWsfWlanInfo& aWlanInfo ) |
1586 core_tx_rate_e CWsfWlanScanner::ConvertTxRateToTxRateEnum( TUint8 aRate ) |
1584 { |
1587 { |
1585 LOG_ENTERFN( "CWsfWlanScanner::RefreshMaxRate" ); |
1588 LOG_ENTERFN( "CWsfWlanScanner::ConvertTxRateToTxRateEnum" ); |
1586 |
1589 |
1587 TUint8 ieLen( 0 ); |
1590 switch ( aRate ) |
|
1591 { |
|
1592 case core_tx_rate_value_1mbit: |
|
1593 return core_tx_rate_1mbit; |
|
1594 case core_tx_rate_value_2mbit: |
|
1595 return core_tx_rate_2mbit; |
|
1596 case core_tx_rate_value_5p5mbit: |
|
1597 return core_tx_rate_5p5mbit; |
|
1598 case core_tx_rate_value_6mbit: |
|
1599 return core_tx_rate_6mbit; |
|
1600 case core_tx_rate_value_9mbit: |
|
1601 return core_tx_rate_9mbit; |
|
1602 case core_tx_rate_value_11mbit: |
|
1603 return core_tx_rate_11mbit; |
|
1604 case core_tx_rate_value_12mbit: |
|
1605 return core_tx_rate_12mbit; |
|
1606 case core_tx_rate_value_18mbit: |
|
1607 return core_tx_rate_18mbit; |
|
1608 case core_tx_rate_value_22mbit: |
|
1609 return core_tx_rate_22mbit; |
|
1610 case core_tx_rate_value_24mbit: |
|
1611 return core_tx_rate_24mbit; |
|
1612 case core_tx_rate_value_33mbit: |
|
1613 return core_tx_rate_33mbit; |
|
1614 case core_tx_rate_value_36mbit: |
|
1615 return core_tx_rate_36mbit; |
|
1616 case core_tx_rate_value_48mbit: |
|
1617 return core_tx_rate_48mbit; |
|
1618 case core_tx_rate_value_54mbit: |
|
1619 return core_tx_rate_54mbit; |
|
1620 default: |
|
1621 return core_tx_rate_none; |
|
1622 } |
|
1623 } |
|
1624 |
|
1625 |
|
1626 // --------------------------------------------------------------------------- |
|
1627 // CWsfWlanScanner::RefreshTechnology |
|
1628 // --------------------------------------------------------------------------- |
|
1629 // |
|
1630 void CWsfWlanScanner::RefreshTechnology( TWsfWlanInfo& aWlanInfo ) |
|
1631 { |
|
1632 LOG_ENTERFN( "CWsfWlanScanner::RefreshTechnology" ); |
|
1633 |
|
1634 TUint8 ieLen(0); |
1588 const TUint8* ieData; |
1635 const TUint8* ieData; |
1589 TUint8 dataRates[KMaxNumberOfRates]; |
1636 TUint8 dataRates[KMaxNumberOfRates]; |
1590 TUint8 maxDataRate( aWlanInfo.iTransferRate * 2 ); |
1637 |
1591 |
1638 if ( iScanInfo->InformationElement( E802Dot11HtCapabilitiesIE, ieLen, |
1592 Mem::FillZ( &dataRates[0], sizeof( dataRates ) ); |
1639 &ieData ) == 0 ) |
1593 |
1640 { |
1594 // Supported Rates |
1641 // 802.11n supported |
1595 iScanInfo->InformationElement( E802Dot11SupportedRatesIE, ieLen, &ieData ); |
1642 aWlanInfo.iTransferRate = 0x8; |
1596 |
1643 } |
1597 Mem::Copy( dataRates, ieData, ieLen ); |
1644 else |
1598 |
1645 { |
1599 for ( TInt a = 0; a < ieLen; a++ ) |
1646 Mem::FillZ( &dataRates[0], sizeof( dataRates ) ); |
1600 { |
1647 core_tx_rate_e rate( core_tx_rate_none ); |
1601 // ignore the highest bit |
1648 TUint32 basic_rates( 0 ); |
1602 dataRates[a] &= 0x7f; |
1649 TUint32 supported_rates( 0 ); |
1603 if ( maxDataRate < dataRates[a] ) |
1650 |
1604 { |
1651 // Supported Rates |
1605 maxDataRate = dataRates[a]; |
1652 iScanInfo->InformationElement( E802Dot11SupportedRatesIE, ieLen, |
1606 } |
1653 &ieData ); |
1607 } |
1654 |
1608 |
1655 Mem::Copy( dataRates, ieData, ieLen ); |
1609 // Extended Supported Rates |
1656 |
1610 Mem::FillZ( &dataRates[0], sizeof( dataRates ) ); |
1657 TUint32 temp_basic_rates( 0 ); |
1611 |
1658 TUint32 temp_supported_rates( 0 ); |
1612 iScanInfo->InformationElement( E802Dot11ExtendedRatesIE, ieLen, &ieData ); |
1659 |
1613 |
|
1614 Mem::Copy( dataRates, ieData, ieLen ); |
|
1615 |
|
1616 if ( ieData ) |
|
1617 { |
|
1618 for ( TInt a = 0; a < ieLen; a++ ) |
1660 for ( TInt a = 0; a < ieLen; a++ ) |
1619 { |
1661 { |
1620 dataRates[a] &= 0x7f; |
1662 rate = ConvertTxRateToTxRateEnum( dataRates[a] |
1621 if ( maxDataRate < dataRates[a] ) |
1663 & ~TX_RATE_BASIC_MASK ); |
|
1664 |
|
1665 temp_supported_rates |= rate; |
|
1666 |
|
1667 if ( dataRates[a] & TX_RATE_BASIC_MASK ) |
1622 { |
1668 { |
1623 maxDataRate = dataRates[a]; |
1669 /** |
|
1670 * The highest bit is enabled, the rate is both a basic rate |
|
1671 * and a supported rate. |
|
1672 */ |
|
1673 temp_basic_rates |= rate; |
1624 } |
1674 } |
1625 } |
1675 } |
1626 } |
1676 |
1627 aWlanInfo.iTransferRate = maxDataRate / 2; |
1677 basic_rates |= temp_basic_rates; |
1628 LOG_WRITEF( "maxRate = %d", aWlanInfo.iTransferRate ); |
1678 supported_rates |= temp_supported_rates; |
|
1679 |
|
1680 // Extended Supported Rates |
|
1681 Mem::FillZ( &dataRates[0], sizeof( dataRates ) ); |
|
1682 |
|
1683 iScanInfo->InformationElement( E802Dot11ExtendedRatesIE, ieLen, |
|
1684 &ieData ); |
|
1685 |
|
1686 Mem::Copy( dataRates, ieData, ieLen ); |
|
1687 |
|
1688 if ( ieData ) |
|
1689 { |
|
1690 temp_basic_rates = 0; |
|
1691 temp_supported_rates = 0; |
|
1692 |
|
1693 for ( TInt a = 0; a < ieLen; a++ ) |
|
1694 { |
|
1695 rate = ConvertTxRateToTxRateEnum( dataRates[a] |
|
1696 & ~TX_RATE_BASIC_MASK ); |
|
1697 |
|
1698 temp_supported_rates |= rate; |
|
1699 |
|
1700 if ( dataRates[a] & TX_RATE_BASIC_MASK ) |
|
1701 { |
|
1702 /** |
|
1703 * The highest bit is enabled, the rate is both a basic rate |
|
1704 * and a supported rate. |
|
1705 */ |
|
1706 temp_basic_rates |= rate; |
|
1707 } |
|
1708 } |
|
1709 |
|
1710 basic_rates |= temp_basic_rates; |
|
1711 supported_rates |= temp_supported_rates; |
|
1712 } |
|
1713 |
|
1714 aWlanInfo.iTransferRate = 0x4; // 802.11bg |
|
1715 |
|
1716 // AP is 802.11b only if only 802.11b rates |
|
1717 // are advertised as supported rates. |
|
1718 if ( !( supported_rates & ~CORE_TX_RATES_802P11B ) ) |
|
1719 { |
|
1720 aWlanInfo.iTransferRate = 0x1; // 802.11b |
|
1721 } |
|
1722 // AP is 802.11g only if any of the 802.11g rates is a basic rate. |
|
1723 else if ( basic_rates & CORE_TX_RATES_802P11G ) |
|
1724 { |
|
1725 aWlanInfo.iTransferRate = 0x2; // 802.11g |
|
1726 } |
|
1727 } |
|
1728 |
|
1729 LOG_WRITEF( "technology = %d", aWlanInfo.iTransferRate ); |
1629 } |
1730 } |
1630 |
1731 |
1631 |
1732 |
1632 // --------------------------------------------------------------------------- |
1733 // --------------------------------------------------------------------------- |
1633 // CWsfWlanScanner::ConnectionEstablishedL |
1734 // CWsfWlanScanner::ConnectionEstablishedL |