Changes in uspace/drv/nic/ar9271/htc.c [b7fd2a0:8a64320e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ar9271/htc.c
rb7fd2a0 r8a64320e 36 36 #include <byteorder.h> 37 37 #include <errno.h> 38 #include <str_error.h>39 38 #include "wmi.h" 40 39 #include "htc.h" … … 66 65 } 67 66 68 errno_t htc_init_new_vif(htc_device_t *htc_device)67 int htc_init_new_vif(htc_device_t *htc_device) 69 68 { 70 69 htc_vif_msg_t vif_msg; … … 150 149 * @param endpoint_id Destination endpoint. 151 150 * 152 * @return EOK if succeed, error code otherwise.153 * 154 */ 155 errno_t htc_send_control_message(htc_device_t *htc_device, void *buffer,151 * @return EOK if succeed, negative error code otherwise. 152 * 153 */ 154 int htc_send_control_message(htc_device_t *htc_device, void *buffer, 156 155 size_t buffer_size, uint8_t endpoint_id) 157 156 { … … 173 172 * @param endpoint_id Destination endpoint. 174 173 * 175 * @return EOK if succeed, error code otherwise.176 * 177 */ 178 errno_t htc_send_data_message(htc_device_t *htc_device, void *buffer,174 * @return EOK if succeed, negative error code otherwise. 175 * 176 */ 177 int htc_send_data_message(htc_device_t *htc_device, void *buffer, 179 178 size_t buffer_size, uint8_t endpoint_id) 180 179 { … … 196 195 * @param transferred_size Real size of read data. 197 196 * 198 * @return EOK if succeed, error code otherwise.199 * 200 */ 201 errno_t htc_read_data_message(htc_device_t *htc_device, void *buffer,197 * @return EOK if succeed, negative error code otherwise. 198 * 199 */ 200 int htc_read_data_message(htc_device_t *htc_device, void *buffer, 202 201 size_t buffer_size, size_t *transferred_size) 203 202 { … … 216 215 * @param transferred_size Real size of read data. 217 216 * 218 * @return EOK if succeed, error code otherwise.219 * 220 */ 221 errno_t htc_read_control_message(htc_device_t *htc_device, void *buffer,217 * @return EOK if succeed, negative error code otherwise. 218 * 219 */ 220 int htc_read_control_message(htc_device_t *htc_device, void *buffer, 222 221 size_t buffer_size, size_t *transferred_size) 223 222 { … … 236 235 * 237 236 * @return EOK if succeed, EINVAL when failed to connect service, 238 * error code otherwise.239 * 240 */ 241 static errno_t htc_connect_service(htc_device_t *htc_device,237 * negative error code otherwise. 238 * 239 */ 240 static int htc_connect_service(htc_device_t *htc_device, 242 241 wmi_services_t service_id, int *response_endpoint_no) 243 242 { … … 261 260 262 261 /* Send HTC message. */ 263 errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,262 int rc = htc_send_control_message(htc_device, buffer, buffer_size, 264 263 htc_device->endpoints.ctrl_endpoint); 265 264 if (rc != EOK) { 266 265 free(buffer); 267 usb_log_error("Failed to send HTC message. Error: % s\n", str_error_name(rc));266 usb_log_error("Failed to send HTC message. Error: %d\n", rc); 268 267 return rc; 269 268 } … … 279 278 free(buffer); 280 279 usb_log_error("Failed to receive HTC service connect response. " 281 "Error: % s\n", str_error_name(rc));280 "Error: %d\n", rc); 282 281 return rc; 283 282 } … … 309 308 * @param htc_device HTC device structure. 310 309 * 311 * @return EOK if succeed, error code otherwise.312 * 313 */ 314 static errno_t htc_config_credits(htc_device_t *htc_device)310 * @return EOK if succeed, negative error code otherwise. 311 * 312 */ 313 static int htc_config_credits(htc_device_t *htc_device) 315 314 { 316 315 size_t buffer_size = sizeof(htc_frame_header_t) + … … 327 326 328 327 /* Send HTC message. */ 329 errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,328 int rc = htc_send_control_message(htc_device, buffer, buffer_size, 330 329 htc_device->endpoints.ctrl_endpoint); 331 330 if (rc != EOK) { 332 331 free(buffer); 333 332 usb_log_error("Failed to send HTC config message. " 334 "Error: % s\n", str_error_name(rc));333 "Error: %d\n", rc); 335 334 return rc; 336 335 } … … 345 344 if (rc != EOK) { 346 345 usb_log_error("Failed to receive HTC config response message. " 347 "Error: % s\n", str_error_name(rc));346 "Error: %d\n", rc); 348 347 } 349 348 … … 357 356 * @param htc_device HTC device structure. 358 357 * 359 * @return EOK if succeed, error code otherwise.360 * 361 */ 362 static errno_t htc_complete_setup(htc_device_t *htc_device)358 * @return EOK if succeed, negative error code otherwise. 359 * 360 */ 361 static int htc_complete_setup(htc_device_t *htc_device) 363 362 { 364 363 size_t buffer_size = sizeof(htc_frame_header_t) + … … 373 372 374 373 /* Send HTC message. */ 375 errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,374 int rc = htc_send_control_message(htc_device, buffer, buffer_size, 376 375 htc_device->endpoints.ctrl_endpoint); 377 376 if (rc != EOK) 378 377 usb_log_error("Failed to send HTC setup complete message. " 379 "Error: % s\n", str_error_name(rc));378 "Error: %d\n", rc); 380 379 381 380 free(buffer); … … 391 390 * 392 391 * @return EOK if succeed, EINVAL if response error, 393 * error code otherwise.394 * 395 */ 396 static errno_t htc_check_ready(htc_device_t *htc_device)392 * negative error code otherwise. 393 * 394 */ 395 static int htc_check_ready(htc_device_t *htc_device) 397 396 { 398 397 size_t buffer_size = htc_device->ath_device->ctrl_response_length; … … 400 399 401 400 /* Read response from device. */ 402 errno_t rc = htc_read_control_message(htc_device, buffer, buffer_size,401 int rc = htc_read_control_message(htc_device, buffer, buffer_size, 403 402 NULL); 404 403 if (rc != EOK) { 405 404 free(buffer); 406 405 usb_log_error("Failed to receive HTC check ready message. " 407 "Error: % s\n", str_error_name(rc));406 "Error: %d\n", rc); 408 407 return rc; 409 408 } … … 427 426 * @param htc_device HTC device structure to be initialized. 428 427 * 429 * @return EOK if succeed, error code otherwise.430 * 431 */ 432 errno_t htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev,428 * @return EOK if succeed, negative error code otherwise. 429 * 430 */ 431 int htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev, 433 432 htc_device_t *htc_device) 434 433 { … … 448 447 * @param htc_device HTC device structure. 449 448 * 450 * @return EOK if succeed, error code otherwise.451 * 452 */ 453 errno_t htc_init(htc_device_t *htc_device)449 * @return EOK if succeed, negative error code otherwise. 450 * 451 */ 452 int htc_init(htc_device_t *htc_device) 454 453 { 455 454 /* First check ready message in device. */ 456 errno_t rc = htc_check_ready(htc_device);455 int rc = htc_check_ready(htc_device); 457 456 if (rc != EOK) { 458 457 usb_log_error("Device is not in ready state after loading "
Note:
See TracChangeset
for help on using the changeset viewer.