equal
deleted
inserted
replaced
14 * Description: Implementation of RWlanLogicalChannel inline methods. |
14 * Description: Implementation of RWlanLogicalChannel inline methods. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 /* |
18 /* |
19 * %version: 17 % |
19 * %version: 17.1.1 % |
20 */ |
20 */ |
21 |
21 |
22 // ----------------------------------------------------------------------------- |
22 // ----------------------------------------------------------------------------- |
23 // |
23 // |
24 // ----------------------------------------------------------------------------- |
24 // ----------------------------------------------------------------------------- |
37 // |
37 // |
38 inline TInt RWlanLogicalChannel::Open( |
38 inline TInt RWlanLogicalChannel::Open( |
39 TWlanUnit aUnit, |
39 TWlanUnit aUnit, |
40 TOpenParam& aOpenParam ) |
40 TOpenParam& aOpenParam ) |
41 { |
41 { |
42 iWlanSystemInitialized = EFalse; |
42 TInt err = DoCreate( |
43 |
|
44 TInt err = DoCreate( |
|
45 LDD_NAME, |
43 LDD_NAME, |
46 VersionRequired(), |
44 VersionRequired(), |
47 aUnit, |
45 aUnit, |
48 NULL, |
46 NULL, |
49 NULL, |
47 NULL, |
52 if ( err == KErrNone ) |
50 if ( err == KErrNone ) |
53 { |
51 { |
54 // driver load sequence success |
52 // driver load sequence success |
55 // do system init |
53 // do system init |
56 err = InitWlanSystem( aOpenParam ); |
54 err = InitWlanSystem( aOpenParam ); |
57 |
|
58 if ( err == KErrNone ) |
|
59 { |
|
60 // WLAN system successfully initialized |
|
61 iWlanSystemInitialized = ETrue; |
|
62 } |
|
63 } |
55 } |
64 |
56 |
65 return err; |
57 return err; |
66 } |
58 } |
67 |
59 |
69 // |
61 // |
70 // ----------------------------------------------------------------------------- |
62 // ----------------------------------------------------------------------------- |
71 // |
63 // |
72 inline void RWlanLogicalChannel::CloseChannel() |
64 inline void RWlanLogicalChannel::CloseChannel() |
73 { |
65 { |
74 // release WLAN system resources only if we have been able to do the |
66 // request WLAN system resources to be released |
75 // initialization successfully. |
67 // |
76 // This check is done to prevent a release attempt in a case where the |
68 TRequestStatus status; |
77 // device driver framework has not been properly initialized to be able to |
69 DoRequest( EWlanFinitSystem, status ); |
78 // handle requests |
70 User::WaitForRequest(status); |
79 if ( iWlanSystemInitialized ) |
71 |
80 { |
|
81 TRequestStatus status; |
|
82 DoRequest( EWlanFinitSystem, status ); |
|
83 User::WaitForRequest(status); |
|
84 |
|
85 // not initialized any more. This is needed to handle the case |
|
86 // that this method is called multiple times |
|
87 iWlanSystemInitialized = EFalse; |
|
88 } |
|
89 // internally call close |
72 // internally call close |
90 Close(); |
73 Close(); |
91 } |
74 } |
92 |
75 |
93 // ----------------------------------------------------------------------------- |
76 // ----------------------------------------------------------------------------- |