/****************************************************************************** AudioScience HPI driver Copyright (C) 1997-2011 AudioScience Inc. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA HPI Operating System Specific macros for Linux Kernel driver (C) Copyright AudioScience Inc. 1997-2003 ******************************************************************************/ #ifndef _HPIOS_H_ #define _HPIOS_H_ #undef HPI_OS_LINUX_KERNEL #define HPI_OS_LINUX_KERNEL #define HPI_OS_DEFINED #define HPI_BUILD_KERNEL_MODE #include #include #include #include #include #include #include #include #include #define HPI_NO_OS_FILE_OPS /** Details of a memory area allocated with pci_alloc_consistent Need all info for parameters to pci_free_consistent */ struct consistent_dma_area { struct device *pdev; /* looks like dma-mapping dma_devres ?! */ size_t size; void *vaddr; dma_addr_t dma_handle; }; static inline u16 hpios_locked_mem_get_phys_addr(struct consistent_dma_area *locked_mem_handle, u32 *p_physical_addr) { *p_physical_addr = locked_mem_handle->dma_handle; return 0; } static inline u16 hpios_locked_mem_get_virt_addr(struct consistent_dma_area *locked_mem_handle, void **pp_virtual_addr) { *pp_virtual_addr = locked_mem_handle->vaddr; return 0; } static inline u16 hpios_locked_mem_valid(struct consistent_dma_area *locked_mem_handle) { return locked_mem_handle->size != 0; } struct hpi_ioctl_linux { void __user *phm; void __user *phr; }; /* Conflict?: H is already used by a number of drivers hid, bluetooth hci, and some sound drivers sb16, hdsp, emu10k. AFAIK 0xFC is ununsed command */ #define HPI_IOCTL_LINUX _IOWR('H', 0xFC, struct hpi_ioctl_linux) #define HPI_DEBUG_FLAG_ERROR KERN_ERR #define HPI_DEBUG_FLAG_WARNING KERN_WARNING #define HPI_DEBUG_FLAG_NOTICE KERN_NOTICE #define HPI_DEBUG_FLAG_INFO KERN_INFO #define HPI_DEBUG_FLAG_DEBUG KERN_DEBUG #define HPI_DEBUG_FLAG_VERBOSE KERN_DEBUG /* kernel has no verbose */ #include #define HPI_LOCKING struct hpios_spinlock { spinlock_t lock; /* SEE hpios_spinlock */ int lock_context; }; /* The reason for all this evilness is that ALSA calls some of a drivers * operators in atomic context, and some not. But all our functions channel * through the HPI_Message conduit, so we can't handle the different context * per function */ #define IN_LOCK_BH 1 #define IN_LOCK_IRQ 0 static inline void cond_lock(struct hpios_spinlock *l) { if (irqs_disabled()) { /* NO bh or isr can execute on this processor, so ordinary lock will do */ spin_lock(&((l)->lock)); l->lock_context = IN_LOCK_IRQ; } else { spin_lock_bh(&((l)->lock)); l->lock_context = IN_LOCK_BH; } } static inline void cond_unlock(struct hpios_spinlock *l) { if (l->lock_context == IN_LOCK_BH) spin_unlock_bh(&((l)->lock)); else spin_unlock(&((l)->lock)); } #define hpios_msgxlock_init(obj) spin_lock_init(&(obj)->lock) #define hpios_msgxlock_lock(obj) cond_lock(obj) #define hpios_msgxlock_unlock(obj) cond_unlock(obj) #define hpios_dsplock_init(obj) spin_lock_init(&(obj)->dsp_lock.lock) #define hpios_dsplock_lock(obj) cond_lock(&(obj)->dsp_lock) #define hpios_dsplock_unlock(obj) cond_unlock(&(obj)->dsp_lock) #ifdef CONFIG_SND_DEBUG #define HPI_BUILD_DEBUG #endif #define HPI_ALIST_LOCKING #define hpios_alistlock_init(obj) spin_lock_init(&((obj)->list_lock.lock)) #define hpios_alistlock_lock(obj) spin_lock(&((obj)->list_lock.lock)) #define hpios_alistlock_unlock(obj) spin_unlock(&((obj)->list_lock.lock)) struct snd_card; /** pci drvdata points to an instance of this struct */ struct hpi_adapter { struct hpi_adapter_obj *adapter; struct snd_card *snd_card; int irq; int interrupt_mode; void (*interrupt_callback) (struct hpi_adapter *); /* mutex prevents contention for one card between multiple user programs (via ioctl) */ struct mutex mutex; char *p_buffer; size_t buffer_size; }; #endif s='ctrl'>
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-01 11:52:27 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-01 11:52:27 -0800
commit6d04dfc8966019b8b0977b2cb942351f13d2b178 (patch)
tree2d4f239c1daff620704b77a992c1e70ce1ce6b08 /drivers/usb/common/Makefile
parent2883aaea363f7a897ff06d2e6c73ae7aae285bcb (diff)
parent06425c308b92eaf60767bc71d359f4cbc7a561f8 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix handling of interrupt status in stmmac driver. Just because we have masked the event from generating interrupts, doesn't mean the bit won't still be set in the interrupt status register. From Alexey Brodkin. 2) Fix DMA API debugging splats in gianfar driver, from Arseny Solokha. 3) Fix off-by-one error in __ip6_append_data(), from Vlad Yasevich. 4) cls_flow does not match on icmpv6 codes properly, from Simon Horman. 5) Initial MAC address can be set incorrectly in some scenerios, from Ivan Vecera. 6) Packet header pointer arithmetic fix in ip6_tnl_parse_tlv_end_lim(), from Dan Carpenter. 7) Fix divide by zero in __tcp_select_window(), from Eric Dumazet. 8) Fix crash in iwlwifi when unregistering thermal zone, from Jens Axboe. 9) Check for DMA mapping errors in starfire driver, from Alexey Khoroshilov. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (31 commits) tcp: fix 0 divide in __tcp_select_window() ipv6: pointer math error in ip6_tnl_parse_tlv_enc_lim() net: fix ndo_features_check/ndo_fix_features comment ordering net/sched: matchall: Fix configuration race be2net: fix initial MAC setting ipv6: fix flow labels when the traffic class is non-0 net: thunderx: avoid dereferencing xcv when NULL net/sched: cls_flower: Correct matching on ICMPv6 code ipv6: Paritially checksum full MTU frames net/mlx4_core: Avoid command timeouts during VF driver device shutdown gianfar: synchronize DMA API usage by free_skb_rx_queue w/ gfar_new_page net: ethtool: add support for 2500BaseT and 5000BaseT link modes can: bcm: fix hrtimer/tasklet termination in bcm op removal net: adaptec: starfire: add checks for dma mapping errors net: phy: micrel: KSZ8795 do not set SUPPORTED_[Asym_]Pause can: Fix kernel panic at security_sock_rcv_skb net: macb: Fix 64 bit addressing support for GEM stmmac: Discard masked flags in interrupt status register net/mlx5e: Check ets capability before ets query FW command net/mlx5e: Fix update of hash function/key via ethtool ...
Diffstat (limited to 'drivers/usb/common/Makefile')