]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/dvb/siano/smscoreapi.h
Merge branch 'for-2.6.27' of git://linux-nfs.org/~bfields/linux
[linux-2.6-omap-h63xx.git] / drivers / media / dvb / siano / smscoreapi.h
index 2799ea7bb41aee9cf3e5e2ea5febc361c1c873bc..c1f8f1dccb111bd654ff141bb111fbc4e93b53d9 100644 (file)
@@ -26,7 +26,8 @@
 #include <linux/device.h>
 #include <linux/list.h>
 #include <linux/mm.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
+#include <linux/types.h>
 #include <asm/page.h>
 
 #include "dmxdev.h"
@@ -36,8 +37,6 @@
 
 #include <linux/mutex.h>
 
-typedef struct mutex kmutex_t;
-
 #define kmutex_init(_p_) mutex_init(_p_)
 #define kmutex_lock(_p_) mutex_lock(_p_)
 #define kmutex_trylock(_p_) mutex_trylock(_p_)
@@ -50,7 +49,7 @@ typedef struct mutex kmutex_t;
 #define SMS_ALLOC_ALIGNMENT                                    128
 #define SMS_DMA_ALIGNMENT                                      16
 #define SMS_ALIGN_ADDRESS(addr) \
-       ((((u32)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1))
+       ((((uintptr_t)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1))
 
 #define SMS_DEVICE_FAMILY2                                     1
 #define SMS_ROM_NO_RESPONSE                                    2
@@ -378,10 +377,6 @@ extern int smscore_load_firmware(struct smscore_device_t *coredev,
                                 char *filename,
                                 loadfirmware_t loadfirmware_handler);
 
-extern int smscore_load_firmware_from_buffer(struct smscore_device_t *coredev,
-                                            u8 *buffer, int size,
-                                            int new_mode);
-
 extern int smscore_set_device_mode(struct smscore_device_t *coredev, int mode);
 extern int smscore_get_device_mode(struct smscore_device_t *coredev);
 
@@ -395,11 +390,9 @@ extern int smsclient_sendrequest(struct smscore_client_t *client,
 extern void smscore_onresponse(struct smscore_device_t *coredev,
                               struct smscore_buffer_t *cb);
 
-extern int smscore_get_common_buffer_size(struct smscore_device_t *coredev);
-extern int smscore_map_common_buffer(struct smscore_device_t *coredev,
-                                     struct vm_area_struct *vma);
 
-extern struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev);
+extern
+struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev);
 extern void smscore_putbuffer(struct smscore_device_t *coredev,
                              struct smscore_buffer_t *cb);
 
@@ -414,9 +407,28 @@ void smsdvb_unregister(void);
 int smsusb_register(void);
 void smsusb_unregister(void);
 
-#define sms_err(fmt, arg...) printk(KERN_ERR fmt, ##arg)
-#define sms_info(fmt, arg...) printk(KERN_INFO fmt, ##arg)
-#define sms_debug(fmt, arg...) printk(KERN_DEBUG fmt, ##arg)
+/* ------------------------------------------------------------------------ */
+
+extern int sms_debug;
+
+#define DBG_INFO 1
+#define DBG_ADV  2
+
+#define sms_printk(kern, fmt, arg...) \
+       printk(kern "%s: " fmt "\n", __func__, ##arg)
+
+#define dprintk(kern, lvl, fmt, arg...) do {\
+       if (sms_debug & lvl) \
+               sms_printk(kern, fmt, ##arg); } while (0)
+
+#define sms_log(fmt, arg...) sms_printk(KERN_INFO, fmt, ##arg)
+#define sms_err(fmt, arg...) \
+       sms_printk(KERN_ERR, "line: %d: " fmt, __LINE__, ##arg)
+#define sms_warn(fmt, arg...)  sms_printk(KERN_WARNING, fmt, ##arg)
+#define sms_info(fmt, arg...) \
+       dprintk(KERN_INFO, DBG_INFO, fmt, ##arg)
+#define sms_debug(fmt, arg...) \
+       dprintk(KERN_DEBUG, DBG_ADV, fmt, ##arg)
 
 
 #endif /* __smscoreapi_h__ */