Changeset b7fd2a0 in mainline for uspace/lib/ieee80211/src/ieee80211.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ieee80211/src/ieee80211.c

    r36f0738 rb7fd2a0  
    496496}
    497497
    498 static int ieee80211_scan(void *arg)
     498static errno_t ieee80211_scan(void *arg)
    499499{
    500500        assert(arg);
     
    517517 *
    518518 */
    519 static int ieee80211_open(ddf_fun_t *fun)
     519static errno_t ieee80211_open(ddf_fun_t *fun)
    520520{
    521521        nic_t *nic_data = nic_get_from_ddf_fun(fun);
     
    527527        ieee80211_dev->started = true;
    528528       
    529         int rc = ieee80211_dev->ops->start(ieee80211_dev);
     529        errno_t rc = ieee80211_dev->ops->start(ieee80211_dev);
    530530        if (rc != EOK)
    531531                return rc;
     
    655655 *
    656656 */
    657 static int ieee80211_implement(ieee80211_dev_t *ieee80211_dev,
     657static errno_t ieee80211_implement(ieee80211_dev_t *ieee80211_dev,
    658658    ieee80211_ops_t *ieee80211_ops, ieee80211_iface_t *ieee80211_iface,
    659659    nic_iface_t *nic_iface, ddf_dev_ops_t *nic_dev_ops)
     
    731731 *
    732732 */
    733 int ieee80211_device_init(ieee80211_dev_t *ieee80211_dev, ddf_dev_t *ddf_dev)
     733errno_t ieee80211_device_init(ieee80211_dev_t *ieee80211_dev, ddf_dev_t *ddf_dev)
    734734{
    735735        ieee80211_dev->ddf_dev = ddf_dev;
     
    771771 *
    772772 */
    773 int ieee80211_init(ieee80211_dev_t *ieee80211_dev,
     773errno_t ieee80211_init(ieee80211_dev_t *ieee80211_dev,
    774774    ieee80211_ops_t *ieee80211_ops, ieee80211_iface_t *ieee80211_iface,
    775775    nic_iface_t *ieee80211_nic_iface, ddf_dev_ops_t *ieee80211_nic_dev_ops)
    776776{
    777         int rc = ieee80211_implement(ieee80211_dev,
     777        errno_t rc = ieee80211_implement(ieee80211_dev,
    778778            ieee80211_ops, ieee80211_iface,
    779779            ieee80211_nic_iface, ieee80211_nic_dev_ops);
     
    850850 *
    851851 */
    852 int ieee80211_probe_request(ieee80211_dev_t *ieee80211_dev, char *ssid)
     852errno_t ieee80211_probe_request(ieee80211_dev_t *ieee80211_dev, char *ssid)
    853853{
    854854        nic_t *nic = nic_get_from_ddf_dev(ieee80211_dev->ddf_dev);
     
    917917 *
    918918 */
    919 int ieee80211_authenticate(ieee80211_dev_t *ieee80211_dev)
     919errno_t ieee80211_authenticate(ieee80211_dev_t *ieee80211_dev)
    920920{
    921921        nic_t *nic = nic_get_from_ddf_dev(ieee80211_dev->ddf_dev);
     
    967967 *
    968968 */
    969 int ieee80211_associate(ieee80211_dev_t *ieee80211_dev, char *password)
     969errno_t ieee80211_associate(ieee80211_dev_t *ieee80211_dev, char *password)
    970970{
    971971        nic_t *nic = nic_get_from_ddf_dev(ieee80211_dev->ddf_dev);
     
    10571057 *
    10581058 */
    1059 int ieee80211_deauthenticate(ieee80211_dev_t *ieee80211_dev)
     1059errno_t ieee80211_deauthenticate(ieee80211_dev_t *ieee80211_dev)
    10601060{
    10611061        ieee80211_scan_result_t *auth_data =
     
    12411241 *
    12421242 */
    1243 static int ieee80211_process_probe_response(ieee80211_dev_t *ieee80211_dev,
     1243static errno_t ieee80211_process_probe_response(ieee80211_dev_t *ieee80211_dev,
    12441244    ieee80211_mgmt_header_t *mgmt_header, size_t buffer_size)
    12451245{
     
    13271327 *
    13281328 */
    1329 static int ieee80211_process_auth_response(ieee80211_dev_t *ieee80211_dev,
     1329static errno_t ieee80211_process_auth_response(ieee80211_dev_t *ieee80211_dev,
    13301330    ieee80211_mgmt_header_t *mgmt_header)
    13311331{
     
    13561356 *
    13571357 */
    1358 static int ieee80211_process_assoc_response(ieee80211_dev_t *ieee80211_dev,
     1358static errno_t ieee80211_process_assoc_response(ieee80211_dev_t *ieee80211_dev,
    13591359    ieee80211_mgmt_header_t *mgmt_header)
    13601360{
     
    13811381}
    13821382
    1383 static int ieee80211_process_4way_handshake(ieee80211_dev_t *ieee80211_dev,
     1383static errno_t ieee80211_process_4way_handshake(ieee80211_dev_t *ieee80211_dev,
    13841384    void *buffer, size_t buffer_size)
    13851385{
     
    14911491                            (buffer + sizeof(ieee80211_eapol_key_frame_t));
    14921492                       
    1493                         int rc;
     1493                        errno_t rc;
    14941494                        uint8_t work_key[32];
    14951495                       
     
    16101610}
    16111611
    1612 static int ieee80211_process_eapol_frame(ieee80211_dev_t *ieee80211_dev,
     1612static errno_t ieee80211_process_eapol_frame(ieee80211_dev_t *ieee80211_dev,
    16131613    void *buffer, size_t buffer_size)
    16141614{
     
    16321632 *
    16331633 */
    1634 static int ieee80211_process_data(ieee80211_dev_t *ieee80211_dev,
     1634static errno_t ieee80211_process_data(ieee80211_dev_t *ieee80211_dev,
    16351635    void *buffer, size_t buffer_size)
    16361636{
     
    16961696 *
    16971697 */
    1698 int ieee80211_rx_handler(ieee80211_dev_t *ieee80211_dev, void *buffer,
     1698errno_t ieee80211_rx_handler(ieee80211_dev_t *ieee80211_dev, void *buffer,
    16991699    size_t buffer_size)
    17001700{
Note: See TracChangeset for help on using the changeset viewer.