1 /* 2 * Linux port of dhd command line utility, hacked from wl utility. 3 * 4 * Copyright (C) 2012, Broadcom Corporation 5 * 6 * Permission to use, copy, modify, and/or distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 * $Id: dhdu_common.h 308298 2012-01-14 01:35:34Z $ 19 */ 20 21 /* Common header file for dhdu_linux.c and dhdu_ndis.c */ 22 23 #ifndef _dhdu_common_h 24 #define _dhdu_common_h 25 26 #if !defined(RWL_WIFI) && !defined(RWL_SOCKET) && !defined(RWL_SERIAL) 27 28 #define NO_REMOTE 0 29 #define REMOTE_SERIAL 1 30 #define REMOTE_SOCKET 2 31 #define REMOTE_WIFI 3 32 #define REMOTE_DONGLE 4 33 34 /* For cross OS support */ 35 #define LINUX_OS 1 36 #define WIN32_OS 2 37 #define MAC_OSX 3 38 #define BACKLOG 4 39 #define WINVISTA_OS 5 40 #define INDONGLE 6 41 42 #define RWL_WIFI_ACTION_CMD "wifiaction" 43 #define RWL_WIFI_GET_ACTION_CMD "rwlwifivsaction" 44 #define RWL_DONGLE_SET_CMD "dongleset" 45 46 #define SUCCESS 1 47 #define FAIL -1 48 #define NO_PACKET -2 49 #define SERIAL_PORT_ERR -3 50 51 /* Added for debug utility support */ 52 #define ERR stderr 53 #define OUTPUT stdout 54 #define DEBUG_ERR 0x0001 55 #define DEBUG_INFO 0x0002 56 #define DEBUG_DBG 0x0004 57 58 #define DPRINT_ERR if (defined_debug & DEBUG_ERR) \ 59 fprintf 60 #define DPRINT_INFO if (defined_debug & DEBUG_INFO) \ 61 fprintf 62 #define DPRINT_DBG if (defined_debug & DEBUG_DBG) \ 63 fprintf 64 65 extern int wl_get(void *wl, int cmd, void *buf, int len); 66 extern int wl_set(void *wl, int cmd, void *buf, int len); 67 #endif 68 69 /* DHD utility function declarations */ 70 extern int dhd_check(void *dhd); 71 extern int dhd_atoip(const char *a, struct ipv4_addr *n); 72 extern int dhd_option(char ***pargv, char **pifname, int *phelp); 73 void dhd_usage(cmd_t *port_cmds); 74 75 /* Remote DHD declarations */ 76 int remote_type = NO_REMOTE; 77 extern char *g_rwl_buf_mac; 78 extern char* g_rwl_device_name_serial; 79 unsigned short g_rwl_servport; 80 char *g_rwl_servIP = NULL; 81 unsigned short defined_debug = DEBUG_ERR | DEBUG_INFO; 82 83 84 static int process_args(struct ifreq* ifr, char **argv); 85 86 #define dtoh32(i) i 87 #define dtoh16(i) i 88 89 #endif /* _dhdu_common_h_ */ 90