@@ -103,8 +103,10 @@ IOService* AirportItlwm::probe(IOService *provider, SInt32 *score)
103
103
return NULL ;
104
104
}
105
105
106
- bool AirportItlwm::configureInterface (IONetworkInterface *netif) {
106
+ bool AirportItlwm::configureInterface (IONetworkInterface *netif)
107
+ {
107
108
IONetworkData *nd;
109
+ struct _ifnet *ifp = &fHalService ->get80211Controller ()->ic_ac .ac_if ;
108
110
109
111
if (super::configureInterface (netif) == false ) {
110
112
XYLog (" super failed\n " );
@@ -116,8 +118,8 @@ bool AirportItlwm::configureInterface(IONetworkInterface *netif) {
116
118
XYLog (" network statistics buffer unavailable?\n " );
117
119
return false ;
118
120
}
119
- fHalService -> get80211Controller ()-> ic_ac . ac_if . netStat = fpNetStats;
120
- fHalService -> get80211Controller ()-> ic_ac . ac_if . iface = OSDynamicCast (IOEthernetInterface, netif);
121
+ ifp-> netStat = fpNetStats;
122
+ ether_ifattach (ifp, OSDynamicCast (IOEthernetInterface, netif) );
121
123
fpNetStats->collisions = 0 ;
122
124
#ifdef __PRIVATE_SPI__
123
125
netif->configureOutputPullModel (fHalService ->getDriverInfo ()->getTxQueueSize (), 0 , 0 , IOEthernetInterface::kOutputPacketSchedulingModelNormal , 0 );
@@ -515,9 +517,9 @@ void AirportItlwm::stop(IOService *provider)
515
517
disableAdapter (fNetIf );
516
518
setLinkStatus (kIONetworkLinkValid );
517
519
fHalService ->detach (pciNub);
520
+ ether_ifdetach (ifp);
518
521
detachInterface (fNetIf , true );
519
522
OSSafeReleaseNULL (fNetIf );
520
- ifp->iface = NULL ;
521
523
releaseAll ();
522
524
}
523
525
@@ -535,17 +537,15 @@ setLinkStatus(UInt32 status, const IONetworkMedium * activeMedium, UInt64 speed,
535
537
#ifdef __PRIVATE_SPI__
536
538
fNetIf ->startOutputThread ();
537
539
#endif
538
- ifq_set_oactive (&ifq->if_snd );
539
540
getCommandGate ()->runAction (setLinkStateGated, (void *)kIO80211NetworkLinkUp , (void *)0 );
540
541
fNetIf ->setLinkQualityMetric (100 );
541
542
} else if (!(status & kIONetworkLinkNoNetworkChange )) {
542
543
#ifdef __PRIVATE_SPI__
543
544
fNetIf ->stopOutputThread ();
544
545
fNetIf ->flushOutputQueue ();
545
546
#endif
546
- ifq->if_snd -> lockFlush ( );
547
+ ifq_flush (& ifq->if_snd );
547
548
mq_purge (&fHalService ->get80211Controller ()->ic_mgtq );
548
- ifq_clr_oactive (&ifq->if_snd );
549
549
getCommandGate ()->runAction (setLinkStateGated, (void *)kIO80211NetworkLinkDown , (void *)fHalService ->get80211Controller ()->ic_deauth_reason );
550
550
}
551
551
}
@@ -687,14 +687,12 @@ IOReturn AirportItlwm::outputStart(IONetworkInterface *interface, IOOptionBits o
687
687
{
688
688
struct _ifnet *ifp = &fHalService ->get80211Controller ()->ic_ac .ac_if ;
689
689
mbuf_t m = NULL ;
690
- if (! ifq_is_oactive (&ifp->if_snd )) {
690
+ if (ifq_is_oactive (&ifp->if_snd ))
691
691
return kIOReturnNoResources ;
692
- }
693
692
while (kIOReturnSuccess == interface->dequeueOutputPackets (1 , &m)) {
694
693
outputPacket (m, NULL );
695
- if (! ifq_is_oactive (&ifp->if_snd )) {
694
+ if (ifq_is_oactive (&ifp->if_snd ))
696
695
return kIOReturnNoResources ;
697
- }
698
696
}
699
697
return kIOReturnSuccess ;
700
698
}
@@ -706,7 +704,7 @@ UInt32 AirportItlwm::outputPacket(mbuf_t m, void *param)
706
704
IOReturn ret = kIOReturnOutputSuccess ;
707
705
struct _ifnet *ifp = &fHalService ->get80211Controller ()->ic_ac .ac_if ;
708
706
709
- if (fHalService ->get80211Controller ()->ic_state != IEEE80211_S_RUN || ifp->if_snd == NULL ) {
707
+ if (fHalService ->get80211Controller ()->ic_state != IEEE80211_S_RUN || ifp->if_snd . queue == NULL ) {
710
708
if (m && mbuf_type (m) != MBUF_TYPE_FREE) {
711
709
freePacket (m);
712
710
}
@@ -728,7 +726,7 @@ UInt32 AirportItlwm::outputPacket(mbuf_t m, void *param)
728
726
ifp->netStat ->outputErrors ++;
729
727
ret = kIOReturnOutputDropped ;
730
728
}
731
- if (!ifp->if_snd ->lockEnqueue (m)) {
729
+ if (!ifp->if_snd . queue ->lockEnqueue (m)) {
732
730
freePacket (m);
733
731
ret = kIOReturnOutputDropped ;
734
732
}
0 commit comments