/* When done, the reference should be dropped with 'dev_put(wimax_dev->net_dev)'.  */
struct wimax_dev* wimax_dev_get_by_genl_info(struct genl_info *info, int ifindex)
/* When done, the reference should be dropped with 'dev_put(wimax_dev->net_dev)'.  */
struct wimax_dev* wimax_dev_get_by_genl_info(struct genl_info *info, int ifindex)
{
	struct wimax_dev *wimax_dev = NULL;
	d_fnstart(3, NULL, "(info %p ifindex %d)\n", info, ifindex);
	spin_lock(&wimax_id_table_lock);
	list_for_each_entry(wimax_dev, &wimax_id_table, id_table_node) {
		if (wimax_dev->net_dev->ifindex == ifindex) {
			dev_hold(wimax_dev->net_dev);
			goto found;
		}
	}
	wimax_dev = NULL;
	d_printf(1, NULL, "wimax: no devices found with ifindex %d\n",
		 ifindex);
found:
	spin_unlock(&wimax_id_table_lock);
	d_fnend(3, NULL, "(info %p ifindex %d) = %p\n",
		info, ifindex, wimax_dev);
	return wimax_dev;
}