summaryrefslogtreecommitdiff
path: root/drivers/isimodem
diff options
context:
space:
mode:
authorAki Niemi <aki.niemi@nokia.com>2011-04-12 13:38:36 +0300
committerAki Niemi <aki.niemi@nokia.com>2011-04-12 20:39:18 +0300
commit74dbe2da990f5a0bf2b2393c15288a9c6d28b5eb (patch)
tree8b6109eef0c9ac84c3ff53d7b20125864b43bca8 /drivers/isimodem
parente17da972e2e7d1c7789aefef1599a50840d8290e (diff)
isimodem: Add helper macros for 16/32bit values
Diffstat (limited to 'drivers/isimodem')
-rw-r--r--drivers/isimodem/isiutil.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/isimodem/isiutil.h b/drivers/isimodem/isiutil.h
index a5a880e6..a1fed1ea 100644
--- a/drivers/isimodem/isiutil.h
+++ b/drivers/isimodem/isiutil.h
@@ -65,10 +65,18 @@ static inline struct isi_cb_data *isi_cb_data_new(void *user, void *cb,
g_isi_msg_version_major((msg)), \
g_isi_msg_version_minor((msg)));
+#define ISI_VERSION_AT_LEAST(ver,maj,min) \
+ ((ver) != NULL && ((ver)->major > (maj) || \
+ ((ver)->major == (maj) && \
+ (ver)->minor >= (min))))
+
#define ALIGN4(val) (((val) + 3) & ~3)
-#define ISI_VERSION_AT_LEAST(ver,maj,min) \
- ((ver) != NULL && ((ver)->major > (maj) || \
- ((ver)->major == (maj) && (ver)->minor >= (min))))
+#define ISI_16BIT(val) \
+ (((val) >> 8) & 0xFF), ((val & 0xFF))
+
+#define ISI_32BIT(val) \
+ (((val) >> 24) & 0xFF), (((val) >> 16) & 0xFF), \
+ (((val) >> 8) & 0xFF), ((val) & 0xFF)
#endif /* !__ISIMODEM_UTIL_H */