Source
static DEVICE_ATTR(RSSI, S_IRUGO | S_IWUSR, uwb_dev_RSSI_show, uwb_dev_RSSI_store);
/*
* Ultra Wide Band
* Life cycle of devices
*
* Copyright (C) 2005-2006 Intel Corporation
* Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
*
* FIXME: docs
*/
/* We initialize addresses to 0xff (invalid, as it is bcast) */
static inline void uwb_dev_addr_init(struct uwb_dev_addr *addr)
{
memset(&addr->data, 0xff, sizeof(addr->data));
}
static inline void uwb_mac_addr_init(struct uwb_mac_addr *addr)
{
memset(&addr->data, 0xff, sizeof(addr->data));
}
/*
* Add callback @new to be called when an event occurs in @rc.
*/
int uwb_notifs_register(struct uwb_rc *rc, struct uwb_notifs_handler *new)
{
if (mutex_lock_interruptible(&rc->notifs_chain.mutex))
return -ERESTARTSYS;
list_add(&new->list_node, &rc->notifs_chain.list);
mutex_unlock(&rc->notifs_chain.mutex);
return 0;
}
EXPORT_SYMBOL_GPL(uwb_notifs_register);
/*
* Remove event handler (callback)
*/
int uwb_notifs_deregister(struct uwb_rc *rc, struct uwb_notifs_handler *entry)
{