Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 56c0930 in mainline for uspace/drv/bus/usb/ar9271/wmi.c


Ignore:
Timestamp:
2015-02-20T14:33:29Z (7 years ago)
Author:
Jan Kolarik <kolarik@…>
Branches:
lfn, master
Children:
4cb0148
Parents:
ab365c4
Message:

Started writing TX and RX handlers, VIF init, setting RX filter, PLL init and calibration, some corrections. Added HW values array initialization, registered diagnostic polling fibril. But still not receiving any packets…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ar9271/wmi.c

    rab365c4 r56c0930  
    5454        uint32_t cmd_value = host2uint32_t_be(reg_offset);
    5555       
    56         size_t buffer_size = MAX_RESPONSE_LENGTH;
    57         void *resp_buffer = malloc(buffer_size);
     56        void *resp_buffer =
     57                malloc(htc_device->ath_device->ctrl_response_length);
    5858       
    5959        int rc = wmi_send_command(htc_device, WMI_REG_READ,
     
    9090        };
    9191       
    92         void *resp_buffer = malloc(MAX_RESPONSE_LENGTH);
     92        void *resp_buffer =
     93                malloc(htc_device->ath_device->ctrl_response_length);
    9394       
    9495        int rc = wmi_send_command(htc_device, WMI_REG_WRITE,
     
    115116 * @return EOK if succeed, negative error code otherwise.
    116117 */
    117 int wmi_reg_clear_set_bit(htc_device_t *htc_device, uint32_t reg_offset,
     118int wmi_reg_set_clear_bit(htc_device_t *htc_device, uint32_t reg_offset,
    118119        uint32_t set_bit, uint32_t clear_bit)
    119120{
     
    152153        uint32_t set_bit)
    153154{
    154         return wmi_reg_clear_set_bit(htc_device, reg_offset, set_bit, 0);
     155        return wmi_reg_set_clear_bit(htc_device, reg_offset, set_bit, 0);
    155156}
    156157
     
    167168        uint32_t clear_bit)
    168169{
    169         return wmi_reg_clear_set_bit(htc_device, reg_offset, 0, clear_bit);
     170        return wmi_reg_set_clear_bit(htc_device, reg_offset, 0, clear_bit);
    170171}
    171172
     
    184185        size_t buffer_size = sizeof(wmi_reg_t) * elements;
    185186        void *buffer = malloc(buffer_size);
    186         void *resp_buffer = malloc(MAX_RESPONSE_LENGTH);
     187        void *resp_buffer =
     188                malloc(htc_device->ath_device->ctrl_response_length);
    187189       
    188190        /* Convert values to correct endianness. */
     
    240242       
    241243        /* Send message. */
    242         int rc = htc_send_message(htc_device, buffer, buffer_size,
     244        int rc = htc_send_control_message(htc_device, buffer, buffer_size,
    243245                htc_device->endpoints.wmi_endpoint);
    244246        if(rc != EOK) {
     
    251253       
    252254        bool clean_resp_buffer = false;
     255        size_t response_buffer_size =
     256                htc_device->ath_device->ctrl_response_length;
    253257        if(response_buffer == NULL) {
    254                 response_buffer = malloc(MAX_RESPONSE_LENGTH);
     258                response_buffer = malloc(response_buffer_size);
    255259                clean_resp_buffer = true;
    256260        }
    257261       
    258262        /* Read response. */
    259         rc = htc_read_message(htc_device, response_buffer, MAX_RESPONSE_LENGTH,
    260                 NULL);
     263        rc = htc_read_control_message(htc_device, response_buffer,
     264                response_buffer_size, NULL);
    261265        if(rc != EOK) {
    262266                free(buffer);
Note: See TracChangeset for help on using the changeset viewer.