Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: sep: handle the memrar stuff in the headers

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Alan Cox and committed by
Greg Kroah-Hartman
266aa856 62a8c3a3

+21 -133
+19
drivers/staging/memrar/memrar.h
··· 95 95 dma_addr_t bus_address; 96 96 }; 97 97 98 + #if defined(CONFIG_MRST_RAR_HANDLER) 98 99 /** 99 100 * rar_reserve() - reserve RAR buffers 100 101 * @buffers: array of RAR_buffers where type and size of buffers to ··· 150 149 extern size_t rar_handle_to_bus(struct RAR_buffer *buffers, 151 150 size_t count); 152 151 152 + #else 153 153 154 + extern inline size_t rar_reserve(struct RAR_buffer *buffers, size_t count) 155 + { 156 + return 0; 157 + } 158 + 159 + extern inline size_t rar_release(struct RAR_buffer *buffers, size_t count) 160 + { 161 + return 0; 162 + } 163 + 164 + extern inline size_t rar_handle_to_bus(struct RAR_buffer *buffers, 165 + size_t count) 166 + { 167 + return 0; 168 + } 169 + 170 + #endif /* MRST_RAR_HANDLER */ 154 171 #endif /* __KERNEL__ */ 155 172 156 173 #endif /* _MEMRAR_H */
+2
drivers/staging/sep/sep_driver.c
··· 59 59 #include <linux/connector.h> 60 60 #include <linux/cn_proc.h> 61 61 62 + #include "../memrar/memrar.h" 63 + 62 64 #include "sep_driver_hw_defs.h" 63 65 #include "sep_driver_config.h" 64 66 #include "sep_driver_api.h"
-133
drivers/staging/sep/sep_driver_config.h
··· 230 230 /* the token that defines the data pool pointers address */ 231 231 #define SEP_EXT_CACHE_ADDR_VAL_TOKEN 0xBABABABA 232 232 233 - /* rar handler */ 234 - #ifndef CONFIG_MRST_RAR_HANDLER 235 - 236 - /* This stub header is for non Moorestown driver only */ 237 - 238 - /* 239 - * @struct RAR_stat 240 - * 241 - * @brief This structure is used for @c RAR_HANDLER_STAT ioctl and for 242 - * @c RAR_get_stat() user space wrapper function. 243 - */ 244 - struct RAR_stat { 245 - /* Type of RAR memory (e.g., audio vs. video) */ 246 - __u32 type; 247 - 248 - /* 249 - * Total size of RAR memory region. 250 - */ 251 - __u32 capacity; 252 - 253 - /* Size of the largest reservable block. */ 254 - __u32 largest_block_size; 255 - }; 256 - 257 - 258 - /* 259 - * @struct RAR_block_info 260 - * 261 - * @brief The argument for the @c RAR_HANDLER_RESERVE @c ioctl. 262 - * 263 - */ 264 - struct RAR_block_info { 265 - /* Type of RAR memory (e.g., audio vs. video) */ 266 - __u32 type; 267 - 268 - /* Requested size of a block to be reserved in RAR. */ 269 - __u32 size; 270 - 271 - /* Handle that can be used to refer to reserved block. */ 272 - __u32 handle; 273 - }; 274 - 275 - /* 276 - * @struct RAR_buffer 277 - * 278 - * Structure that contains all information related to a given block of 279 - * memory in RAR. It is generally only used when retrieving bus 280 - * addresses. 281 - * 282 - * @note This structure is used only by RAR-enabled drivers, and is 283 - * not intended to be exposed to the user space. 284 - */ 285 - struct RAR_buffer { 286 - /* Structure containing base RAR buffer information */ 287 - struct RAR_block_info info; 288 - 289 - /* Buffer bus address */ 290 - __u32 bus_address; 291 - }; 292 - 293 - 294 - #define RAR_IOCTL_BASE 0xE0 295 - 296 - /* Reserve RAR block. */ 297 - #define RAR_HANDLER_RESERVE _IOWR(RAR_IOCTL_BASE, 0x00, struct RAR_block_info) 298 - 299 - /* Release previously reserved RAR block. */ 300 - #define RAR_HANDLER_RELEASE _IOW(RAR_IOCTL_BASE, 0x01, __u32) 301 - 302 - /* Get RAR stats. */ 303 - #define RAR_HANDLER_STAT _IOWR(RAR_IOCTL_BASE, 0x02, struct RAR_stat) 304 - 305 - 306 - /* -------------------------------------------------------------- */ 307 - /* Kernel Side RAR Handler Interface */ 308 - /* -------------------------------------------------------------- */ 309 - 310 - /* 311 - * @function rar_reserve 312 - * 313 - * @brief Reserve RAR buffers. 314 - * 315 - * This function will reserve buffers in the restricted access regions 316 - * of given types. 317 - * 318 - * @return Number of successfully reserved buffers. 319 - * Successful buffer reservations will have the corresponding 320 - * @c bus_address field set to a non-zero value in the 321 - * given @a buffers vector. 322 - */ 323 - #define rar_reserve(a, b) ((size_t)NULL) 324 - 325 - /* 326 - * @function rar_release 327 - * 328 - * @brief Release RAR buffers retrieved through call to 329 - * @c rar_reserve() or @c rar_handle_to_bus(). 330 - * 331 - * This function will release RAR buffers that were retrieved through 332 - * a call to @c rar_reserve() or @c rar_handle_to_bus() by 333 - * decrementing the reference count. The RAR buffer will be reclaimed 334 - * when the reference count drops to zero. 335 - * 336 - * @return Number of successfully released buffers. 337 - * Successful releases will have their handle field set to 338 - * zero in the given @a buffers vector. 339 - */ 340 - #define rar_release(a, b) ((size_t)NULL) 341 - 342 - /* 343 - * @function rar_handle_to_bus 344 - * 345 - * @brief Convert a vector of RAR handles to bus addresses. 346 - * 347 - * This function will retrieve the RAR buffer bus addresses, type and 348 - * size corresponding to the RAR handles provided in the @a buffers 349 - * vector. 350 - * 351 - * @return Number of successfully converted buffers. 352 - * The bus address will be set to @c 0 for unrecognized 353 - * handles. 354 - * 355 - * @note The reference count for each corresponding buffer in RAR will 356 - * be incremented. Call @c rar_release() when done with the 357 - * buffers. 358 - */ 359 - #define rar_handle_to_bus(a, b) ((size_t)NULL) 360 - 361 - #else /* using rear memrar */ 362 - 363 - #include "../memrar/memrar.h" 364 - 365 - #endif /* MEMRAR */ 366 233 367 234 #endif /* SEP DRIVER CONFIG */