1c46917bbSLuis R. Rodriguez /* 2c46917bbSLuis R. Rodriguez * Copyright (c) 2009 Atheros Communications Inc. 3c46917bbSLuis R. Rodriguez * 4c46917bbSLuis R. Rodriguez * Permission to use, copy, modify, and/or distribute this software for any 5c46917bbSLuis R. Rodriguez * purpose with or without fee is hereby granted, provided that the above 6c46917bbSLuis R. Rodriguez * copyright notice and this permission notice appear in all copies. 7c46917bbSLuis R. Rodriguez * 8c46917bbSLuis R. Rodriguez * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9c46917bbSLuis R. Rodriguez * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10c46917bbSLuis R. Rodriguez * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11c46917bbSLuis R. Rodriguez * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12c46917bbSLuis R. Rodriguez * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13c46917bbSLuis R. Rodriguez * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14c46917bbSLuis R. Rodriguez * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15c46917bbSLuis R. Rodriguez */ 16c46917bbSLuis R. Rodriguez 17c46917bbSLuis R. Rodriguez #include "ath.h" 18c46917bbSLuis R. Rodriguez #include "debug.h" 19c46917bbSLuis R. Rodriguez 20c46917bbSLuis R. Rodriguez void ath_print(struct ath_common *common, int dbg_mask, const char *fmt, ...) 21c46917bbSLuis R. Rodriguez { 22c46917bbSLuis R. Rodriguez va_list args; 23c46917bbSLuis R. Rodriguez 24c46917bbSLuis R. Rodriguez if (likely(!(common->debug_mask & dbg_mask))) 25c46917bbSLuis R. Rodriguez return; 26c46917bbSLuis R. Rodriguez 27c46917bbSLuis R. Rodriguez va_start(args, fmt); 28c46917bbSLuis R. Rodriguez printk(KERN_DEBUG "ath: "); 29c46917bbSLuis R. Rodriguez vprintk(fmt, args); 30c46917bbSLuis R. Rodriguez va_end(args); 31c46917bbSLuis R. Rodriguez } 32c46917bbSLuis R. Rodriguez EXPORT_SYMBOL(ath_print); 3392c68a66SBen Greear 3492c68a66SBen Greear const char *ath_opmode_to_string(enum nl80211_iftype opmode) 3592c68a66SBen Greear { 3692c68a66SBen Greear switch (opmode) { 3792c68a66SBen Greear case NL80211_IFTYPE_UNSPECIFIED: 3892c68a66SBen Greear return "UNSPEC"; 3992c68a66SBen Greear case NL80211_IFTYPE_ADHOC: 4092c68a66SBen Greear return "ADHOC"; 4192c68a66SBen Greear case NL80211_IFTYPE_STATION: 4292c68a66SBen Greear return "STATION"; 4392c68a66SBen Greear case NL80211_IFTYPE_AP: 4492c68a66SBen Greear return "AP"; 4592c68a66SBen Greear case NL80211_IFTYPE_AP_VLAN: 4692c68a66SBen Greear return "AP-VLAN"; 4792c68a66SBen Greear case NL80211_IFTYPE_WDS: 4892c68a66SBen Greear return "WDS"; 4992c68a66SBen Greear case NL80211_IFTYPE_MONITOR: 5092c68a66SBen Greear return "MONITOR"; 5192c68a66SBen Greear case NL80211_IFTYPE_MESH_POINT: 5292c68a66SBen Greear return "MESH"; 5392c68a66SBen Greear case NL80211_IFTYPE_P2P_CLIENT: 5492c68a66SBen Greear return "P2P-CLIENT"; 5592c68a66SBen Greear case NL80211_IFTYPE_P2P_GO: 5692c68a66SBen Greear return "P2P-GO"; 5792c68a66SBen Greear default: 58908ebfb9SJoe Perches return "UNKNOWN"; 5992c68a66SBen Greear } 6092c68a66SBen Greear } 6192c68a66SBen Greear EXPORT_SYMBOL(ath_opmode_to_string); 62