138 // CUsbPnIsaReceiver::RunL |
138 // CUsbPnIsaReceiver::RunL |
139 // ----------------------------------------------------------------------------- |
139 // ----------------------------------------------------------------------------- |
140 // |
140 // |
141 void CUsbPnIsaReceiver::RunL( ) |
141 void CUsbPnIsaReceiver::RunL( ) |
142 { |
142 { |
143 OstTrace1( TRACE_API, CUSBPNISARECEIVER_RUNL_ENTRY, "CUsbPnIsaReceiver::RunL;iStatus=%d", iStatus.Int() ); |
143 OstTrace1( TRACE_BORDER, CUSBPNISARECEIVER_RUNL_ENTRY, "CUsbPnIsaReceiver::RunL;iStatus=%d", iStatus.Int() ); |
144 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunL() iStatus:%d" ), iStatus.Int() ) ); |
144 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunL() iStatus:%d" ), iStatus.Int() ) ); |
145 |
145 |
146 User::LeaveIfError(iStatus.Int()); |
146 User::LeaveIfError(iStatus.Int()); |
147 |
147 |
148 iRecvPtr.Set( iPacket->Buffer().Des() ); |
148 iRecvPtr.Set( iPacket->Buffer().Des() ); |
150 #ifndef NCP_COMMON_BRIDGE_FAMILY |
150 #ifndef NCP_COMMON_BRIDGE_FAMILY |
151 //Media specific resp from SOS USB MM |
151 //Media specific resp from SOS USB MM |
152 if( (iRecvPtr[ISI_HEADER_OFFSET_RESOURCEID] == PN_MEDIA_CONTROL) && |
152 if( (iRecvPtr[ISI_HEADER_OFFSET_RESOURCEID] == PN_MEDIA_CONTROL) && |
153 (iRecvPtr[ISI_HEADER_OFFSET_MESSAGEID] == PNS_MEDIA_SPECIFIC_RESP) ) |
153 (iRecvPtr[ISI_HEADER_OFFSET_MESSAGEID] == PNS_MEDIA_SPECIFIC_RESP) ) |
154 { |
154 { |
155 OstTrace0( TRACE_API, CUSBPNISARECEIVER_RUNL, "CUsbPnIsaReceiver::RunL - Media specific resp" ); |
155 OstTrace0( TRACE_BORDER, CUSBPNISARECEIVER_RUNL, "CUsbPnIsaReceiver::RunL - Media specific resp" ); |
156 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunL - Media specific resp" ))); |
156 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunL - Media specific resp" ))); |
157 iPacket->ReleaseL(); |
157 iPacket->ReleaseL(); |
158 ReceivingNextPacket(); |
158 ReceivingNextPacket(); |
159 } |
159 } |
160 else |
160 else |
169 } |
169 } |
170 |
170 |
171 // PC phonet connection not open |
171 // PC phonet connection not open |
172 else |
172 else |
173 { |
173 { |
174 OstTrace0( TRACE_API, CUSBPNISARECEIVER_RUNL_DUP2, "CUsbPnIsaReceiver::RunL - Discarding" ); |
174 OstTrace0( TRACE_BORDER, CUSBPNISARECEIVER_RUNL_DUP2, "CUsbPnIsaReceiver::RunL - Discarding" ); |
175 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunL - Discarding" ))); |
175 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunL - Discarding" ))); |
176 iPacket->ReleaseL(); |
176 iPacket->ReleaseL(); |
177 ReceivingNextPacket(); |
177 ReceivingNextPacket(); |
178 } |
178 } |
179 } |
179 } |
180 |
180 |
181 OstTrace0( TRACE_API, CUSBPNISARECEIVER_RUNL_EXIT, "CUsbPnIsaReceiver::RunL - return void" ); |
181 OstTrace0( TRACE_BORDER, CUSBPNISARECEIVER_RUNL_EXIT, "CUsbPnIsaReceiver::RunL - return void" ); |
182 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunL() - return void" ) ) ); |
182 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunL() - return void" ) ) ); |
183 } |
183 } |
184 |
184 |
185 // ----------------------------------------------------------------------------- |
185 // ----------------------------------------------------------------------------- |
186 // CUsbPnIsaReceiver::ReceivingNextPacket |
186 // CUsbPnIsaReceiver::ReceivingNextPacket |
190 { |
190 { |
191 OstTrace0( TRACE_NORMAL, CUSBPNISARECEIVER_RECEIVINGNEXTPACKET_ENTRY, "CUsbPnIsaReceiver::ReceivingNextPacket" ); |
191 OstTrace0( TRACE_NORMAL, CUSBPNISARECEIVER_RECEIVINGNEXTPACKET_ENTRY, "CUsbPnIsaReceiver::ReceivingNextPacket" ); |
192 C_TRACE( ( _T( "CUsbPnIsaReceiver::ReceivingNextPacket()" ) ) ); |
192 C_TRACE( ( _T( "CUsbPnIsaReceiver::ReceivingNextPacket()" ) ) ); |
193 iRecvPtr.Set( iPacket->Buffer().Des() ); |
193 iRecvPtr.Set( iPacket->Buffer().Des() ); |
194 iIscApi.Receive( iStatus, iRecvPtr, iNeededLength ); |
194 iIscApi.Receive( iStatus, iRecvPtr, iNeededLength ); |
195 OstTrace0( TRACE_DETAILED, CUSBPNISARECEIVER_RECEIVINGNEXTPACKET_DUP1, "CUsbPnIsaReceiver::ReceivingNextPacket - receiving new" ); |
195 OstTrace0( TRACE_INTERNALS, CUSBPNISARECEIVER_RECEIVINGNEXTPACKET_DUP1, "CUsbPnIsaReceiver::ReceivingNextPacket - receiving new" ); |
196 E_TRACE((_T("CUsbPnIsaReceiver::ReceivingNextPacket - Receiving new"))); |
196 E_TRACE((_T("CUsbPnIsaReceiver::ReceivingNextPacket - Receiving new"))); |
197 SetActive(); |
197 SetActive(); |
198 OstTrace0( TRACE_API, CUSBPNISARECEIVER_RECEIVINGNEXTPACKET_EXIT, "CUsbPnIsaReceiver::ReceivingNextPacket - return void" ); |
198 OstTrace0( TRACE_BORDER, CUSBPNISARECEIVER_RECEIVINGNEXTPACKET_EXIT, "CUsbPnIsaReceiver::ReceivingNextPacket - return void" ); |
199 A_TRACE( ( _T( "CUsbPnIsaReceiver::ReceivingNextPacket() - return void" ) ) ); |
199 A_TRACE( ( _T( "CUsbPnIsaReceiver::ReceivingNextPacket() - return void" ) ) ); |
200 } |
200 } |
201 |
201 |
202 // ----------------------------------------------------------------------------- |
202 // ----------------------------------------------------------------------------- |
203 // CUsbPnIsaReceiver::RunError |
203 // CUsbPnIsaReceiver::RunError |
204 // ----------------------------------------------------------------------------- |
204 // ----------------------------------------------------------------------------- |
205 // |
205 // |
206 TInt CUsbPnIsaReceiver::RunError( TInt aError ) |
206 TInt CUsbPnIsaReceiver::RunError( TInt aError ) |
207 { |
207 { |
208 OstTrace1( TRACE_API, CUSBPNISARECEIVER_RUNERROR_ENTRY, "CUsbPnIsaReceiver::RunError;aError=%d", aError ); |
208 OstTrace1( TRACE_BORDER, CUSBPNISARECEIVER_RUNERROR_ENTRY, "CUsbPnIsaReceiver::RunError;aError=%d", aError ); |
209 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunError( aError:%d )" ), aError ) ); |
209 A_TRACE( ( _T( "CUsbPnIsaReceiver::RunError( aError:%d )" ), aError ) ); |
210 |
210 |
211 switch( aError ) |
211 switch( aError ) |
212 { |
212 { |
213 case KErrNoMemory: |
213 case KErrNoMemory: |
214 { |
214 { |
215 OstTrace0( TRACE_DETAILED, CUSBPNISARECEIVER_RUNERROR, "CUsbPnIsaReceiver::RunError - Release packet buffer and alloc bigger for temporary use" ); |
215 OstTrace0( TRACE_INTERNALS, CUSBPNISARECEIVER_RUNERROR, "CUsbPnIsaReceiver::RunError - Release packet buffer and alloc bigger for temporary use" ); |
216 E_TRACE( ( _T( "CUsbPnIsaReceiver::RunError - Release packet buffer and alloc bigger for temporary use" ))); |
216 E_TRACE( ( _T( "CUsbPnIsaReceiver::RunError - Release packet buffer and alloc bigger for temporary use" ))); |
217 aError = KErrNone; |
217 aError = KErrNone; |
218 TRAP( aError, iPacket->ReallocBufferL( iNeededLength ) ); |
218 TRAP( aError, iPacket->ReallocBufferL( iNeededLength ) ); |
219 if( aError == KErrNone ) |
219 if( aError == KErrNone ) |
220 { |
220 { |
295 void CUsbPnIsaReceiver::ConstructMessage() |
295 void CUsbPnIsaReceiver::ConstructMessage() |
296 { |
296 { |
297 OstTrace0( TRACE_NORMAL, CUSBPNISARECEIVER_CONSTRUCTMESSAGE_ENTRY, "CUsbPnIsaReceiver::ConstructMessage" ); |
297 OstTrace0( TRACE_NORMAL, CUSBPNISARECEIVER_CONSTRUCTMESSAGE_ENTRY, "CUsbPnIsaReceiver::ConstructMessage" ); |
298 C_TRACE( ( _T( "CUsbPnIsaReceiver::ConstructMessage()" ) ) ); |
298 C_TRACE( ( _T( "CUsbPnIsaReceiver::ConstructMessage()" ) ) ); |
299 |
299 |
300 OstTrace1( TRACE_DETAILED, CUSBPNISARECEIVER_CONSTRUCTMESSAGE, "CUsbPnIsaReceiver::ConstructMessage - Convert endianness;iRecvPtr.Length()=%d", iRecvPtr.Length() ); |
300 OstTrace1( TRACE_INTERNALS, CUSBPNISARECEIVER_CONSTRUCTMESSAGE, "CUsbPnIsaReceiver::ConstructMessage - Convert endianness;iRecvPtr.Length()=%d", iRecvPtr.Length() ); |
301 E_TRACE( ( _T( "CUsbPnIsaReceiver::ConstructMessage() - Convert endianness - iRecvPtr.Length():%d" ), iRecvPtr.Length() ) ); |
301 E_TRACE( ( _T( "CUsbPnIsaReceiver::ConstructMessage() - Convert endianness - iRecvPtr.Length():%d" ), iRecvPtr.Length() ) ); |
302 #ifdef ISI_LENGTH_LITTLE_ENDIAN |
302 #ifndef ISI_LENGTH_BIG_ENDIAN |
303 TUint8 lsb(iRecvPtr[ISI_HEADER_OFFSET_LENGTH]); |
303 TUint8 lsb(iRecvPtr[ISI_HEADER_OFFSET_LENGTH]); |
304 TUint8 msb(iRecvPtr[ISI_HEADER_OFFSET_LENGTH +1]); |
304 TUint8 msb(iRecvPtr[ISI_HEADER_OFFSET_LENGTH +1]); |
305 iRecvPtr[ISI_HEADER_OFFSET_LENGTH] = msb; |
305 iRecvPtr[ISI_HEADER_OFFSET_LENGTH] = msb; |
306 iRecvPtr[ISI_HEADER_OFFSET_LENGTH +1] = lsb; |
306 iRecvPtr[ISI_HEADER_OFFSET_LENGTH +1] = lsb; |
307 #endif // ISI_LENGTH_LITTLE_ENDIAN |
307 #endif // ISI_LENGTH_BIG_ENDIAN |
308 OstTrace0( TRACE_NORMAL, CUSBPNISARECEIVER_CONSTRUCTMESSAGE_EXIT, "CUsbPnIsaReceiver::ConstructMessage - return void" ); |
308 OstTrace0( TRACE_NORMAL, CUSBPNISARECEIVER_CONSTRUCTMESSAGE_EXIT, "CUsbPnIsaReceiver::ConstructMessage - return void" ); |
309 C_TRACE( ( _T( "CUsbPnIsaReceiver::ConstructMessage() - return void" ) ) ); |
309 C_TRACE( ( _T( "CUsbPnIsaReceiver::ConstructMessage() - return void" ) ) ); |
310 } |
310 } |
311 |
311 |
312 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
312 // ========================== OTHER EXPORTED FUNCTIONS ========================= |