/** * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * This source file is released under GPL v2 license (no other versions). * See the COPYING file included in the main directory of this source * distribution for the license terms and conditions. * * @File cthardware.c * * @Brief * This file contains the implementation of hardware access methord. * * @Author Liu Chun * @Date Jun 26 2008 * */ #include "cthardware.h" #include "cthw20k1.h" #include "cthw20k2.h" #include int create_hw_obj(struct pci_dev *pci, enum CHIPTYP chip_type, enum CTCARDS model, struct hw **rhw) { int err; switch (chip_type) { case ATC20K1: err = create_20k1_hw_obj(rhw); break; case ATC20K2: err = create_20k2_hw_obj(rhw); break; default: err = -ENODEV; break; } if (err) return err; (*rhw)->pci = pci; (*rhw)->chip_type = chip_type; (*rhw)->model = model; return 0; } int destroy_hw_obj(struct hw *hw) { int err; switch (hw->pci->device) { case 0x0005: /* 20k1 device */ err = destroy_20k1_hw_obj(hw); break; case 0x000B: /* 20k2 device */ err = destroy_20k2_hw_obj(hw); break; default: err = -ENODEV; break; } return err; } unsigned int get_field(unsigned int data, unsigned int field) { int i; if (WARN_ON(!field)) return 0; /* @field should always be greater than 0 */ for (i = 0; !(field & (1 << i)); ) i++; return (data & field) >> i; } void set_field(unsigned int *data, unsigned int field, unsigned int value) { int i; if (WARN_ON(!field)) return; /* @field should always be greater than 0 */ for (i = 0; !(field & (1 << i)); ) i++; *data = (*data & (~field)) | ((value << i) & field); } ext.git/log/include/net/irda/qos.h'>logtreecommitdiff
path: root/include/net/irda/qos.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-30 15:47:19 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-30 15:47:19 -0800
commitf9a42e0d58cf0fe3d902e63d4582f2ea4cd2bb8b (patch)
tree4078d3ae27d4ebb85bdcd4d84e9b9a4d059f22bb /include/net/irda/qos.h
parent751321b3dd5040dc5be19bd23f985e80c914621a (diff)
parent54791b276b4000b307339f269d3bf7db877d536f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc fixes from David Miller: "Several small bug fixes and tidies, along with a fix for non-resumable memory errors triggered by userspace" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc64: Handle PIO & MEM non-resumable errors. sparc64: Zero pages on allocation for mondo and error queues. sparc: Fixed typo in sstate.c. Replaced panicing with panicking sparc: use symbolic names for tsb indexing
Diffstat (limited to 'include/net/irda/qos.h')