cregit-Linux how code gets into the kernel

Release 4.16 drivers/net/wireless/mediatek/mt76/util.c

/*
 * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <linux/module.h>
#include "mt76.h"


bool __mt76_poll(struct mt76_dev *dev, u32 offset, u32 mask, u32 val, int timeout) { u32 cur; timeout /= 10; do { cur = dev->bus->rr(dev, offset) & mask; if (cur == val) return true; udelay(10); } while (timeout-- > 0); return false; }

Contributors

PersonTokensPropCommitsCommitProp
Felix Fietkau72100.00%1100.00%
Total72100.00%1100.00%

EXPORT_SYMBOL_GPL(__mt76_poll);
bool __mt76_poll_msec(struct mt76_dev *dev, u32 offset, u32 mask, u32 val, int timeout) { u32 cur; timeout /= 10; do { cur = dev->bus->rr(dev, offset) & mask; if (cur == val) return true; usleep_range(10000, 20000); } while (timeout-- > 0); return false; }

Contributors

PersonTokensPropCommitsCommitProp
Felix Fietkau74100.00%1100.00%
Total74100.00%1100.00%

EXPORT_SYMBOL_GPL(__mt76_poll_msec);
int mt76_wcid_alloc(unsigned long *mask, int size) { int i, idx = 0, cur; for (i = 0; i < size / BITS_PER_LONG; i++) { idx = ffs(~mask[i]); if (!idx) continue; idx--; cur = i * BITS_PER_LONG + idx; if (cur >= size) break; mask[i] |= BIT(idx); return cur; } return -1; }

Contributors

PersonTokensPropCommitsCommitProp
Felix Fietkau91100.00%1100.00%
Total91100.00%1100.00%

EXPORT_SYMBOL_GPL(mt76_wcid_alloc); MODULE_LICENSE("Dual BSD/GPL");

Overall Contributors

PersonTokensPropCommitsCommitProp
Felix Fietkau264100.00%1100.00%
Total264100.00%1100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.