/*
 * Ultra Wide Band
 * IE Received notification handling.
 *
 * Copyright (C) 2008 Cambridge Silicon Radio Ltd.
 *
 * 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, see <http://www.gnu.org/licenses/>.
 */

#include <linux/errno.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/bitmap.h>
#include "uwb-internal.h"

/*
 * Process an incoming IE Received notification.
 */
int uwbd_evt_handle_rc_ie_rcv(struct uwb_event *evt)
{
	int result = -EINVAL;
	struct device *dev = &evt->rc->uwb_dev.dev;
	struct uwb_rc_evt_ie_rcv *iercv;

	/* Is there enough data to decode it? */
	if (evt->notif.size < sizeof(*iercv)) {
		dev_err(dev, "IE Received notification: Not enough data to "
			"decode (%zu vs %zu bytes needed)\n",
			evt->notif.size, sizeof(*iercv));
		goto error;
	}
	iercv = container_of(evt->notif.rceb, struct uwb_rc_evt_ie_rcv, rceb);

	dev_dbg(dev, "IE received, element ID=%d\n", iercv->IEData[0]);

	if (iercv->IEData[0] == UWB_RELINQUISH_REQUEST_IE) {
		dev_warn(dev, "unhandled Relinquish Request IE\n");
	}

	return 0;
error:
	return result;
}
a href='/cgit.cgi/linux/net-next.git/refs/?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>refs</a><a href='/cgit.cgi/linux/net-next.git/log/sound/soc/sh/Kconfig?h=nds-private-remove'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/sound/soc/sh/Kconfig?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/sound/soc/sh/Kconfig?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>commit</a><a class='active' href='/cgit.cgi/linux/net-next.git/diff/sound/soc/sh/Kconfig?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/sound/soc/sh/Kconfig'>
<input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='2fb78e89405f4321b86274a0c24b30896dd50529'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/diff/?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>root</a>/<a href='/cgit.cgi/linux/net-next.git/diff/sound?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>sound</a>/<a href='/cgit.cgi/linux/net-next.git/diff/sound/soc?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>soc</a>/<a href='/cgit.cgi/linux/net-next.git/diff/sound/soc/sh?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>sh</a>/<a href='/cgit.cgi/linux/net-next.git/diff/sound/soc/sh/Kconfig?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>Kconfig</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='2fb78e89405f4321b86274a0c24b30896dd50529'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?h=nds-private-remove&amp;id=2fb78e89405f4321b86274a0c24b30896dd50529'>Diffstat</a> (limited to 'sound/soc/sh/Kconfig')</div><table summary='diffstat' class='diffstat'>