summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2009-11-10 14:23:24 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-10 14:23:24 -0800
commitcabee8336de70650a2e5d3d4bece6f6ea7468a9a (patch)
tree55ec517952232cf7fad913233acf81c082fe70d8
parent1a02757bda09d2794e0b0c6090e82b8d82e06e5e (diff)
parenta90753b25ce9d5558e30e49dbe2769a52d99658e (diff)
downloadti-cabee8336de70650a2e5d3d4bece6f6ea7468a9a.tar.gz
am a90753b2: am 846ab564: tnetw1251: Add 500 ms expired wakelock to deliver the message (b/2245483)
Merge commit 'a90753b25ce9d5558e30e49dbe2769a52d99658e' into eclair-mr2-plus-aosp * commit 'a90753b25ce9d5558e30e49dbe2769a52d99658e': tnetw1251: Add 500 ms expired wakelock to deliver the message (b/2245483)
-rw-r--r--sta_dk_4_0_4_32/pform/linux/src/ipc_k.c94
1 files changed, 48 insertions, 46 deletions
diff --git a/sta_dk_4_0_4_32/pform/linux/src/ipc_k.c b/sta_dk_4_0_4_32/pform/linux/src/ipc_k.c
index 9975c75..9a0bc24 100644
--- a/sta_dk_4_0_4_32/pform/linux/src/ipc_k.c
+++ b/sta_dk_4_0_4_32/pform/linux/src/ipc_k.c
@@ -61,60 +61,62 @@ UINT32 IPCKernelDeInit (TI_HANDLE hAdapter)
/*******************************************************/
INT32 IPC_EventSend(TI_HANDLE hAdapter, tiUINT8* pEvData, UINT32 EvDataSize)
{
- struct sk_buff *skb;
- int res;
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *) hAdapter;
- UINT32 realSize = 0;
- UINT32 msgSize;
- struct nlmsghdr *nlh;
- tiUINT8 *msg;
-
- /* This event is targetted to the OS process Id 0 is not a valid pId for LINUX*/
-
- if ((( IPC_EVENT_PARAMS *) pEvData) ->uProcessID == 0)
- {
- (( IPC_EVENT_PARAMS *) pEvData) ->pfEventCallback(( IPC_EV_DATA *) pEvData);
- return 0;
- }
-
- /* set the payload size */
- msgSize = (( IPC_EV_DATA *) pEvData) ->uBufferSize + offsetof(IPC_EV_DATA,uBuffer);
-
- /* add the netlink header size */
- realSize = NLMSG_SPACE(msgSize);
-
- /* allocate the complete message */
- skb = dev_alloc_skb(realSize);
- if (!skb) {
+ struct sk_buff *skb;
+ int res;
+ tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *) hAdapter;
+ UINT32 realSize = 0;
+ UINT32 msgSize;
+ struct nlmsghdr *nlh;
+ tiUINT8 *msg;
+
+#ifdef CONFIG_ANDROID_POWER
+ drv->receive_packet = 1; /* Remember to stay awake */
+#endif
+ /* This event is targetted to the OS process Id 0 is not a valid pId for LINUX*/
+ if (((IPC_EVENT_PARAMS *)pEvData)->uProcessID == 0)
+ {
+ ((IPC_EVENT_PARAMS *)pEvData)->pfEventCallback((IPC_EV_DATA *)pEvData);
+ return 0;
+ }
+
+ /* set the payload size */
+ msgSize = (( IPC_EV_DATA *) pEvData) ->uBufferSize + offsetof(IPC_EV_DATA,uBuffer);
+
+ /* add the netlink header size */
+ realSize = NLMSG_SPACE(msgSize);
+
+ /* allocate the complete message */
+ skb = dev_alloc_skb(realSize);
+ if (!skb) {
printk(KERN_ERR "Failed to allocate new skb with size=%u.\n",realSize);
return -1;
- }
-
- /* set the netlink header params */
- nlh = NLMSG_PUT(skb, 0, 0, NLMSG_DONE, realSize - sizeof(*nlh));
-
- /* get the payload pointer */
- msg = (char *)NLMSG_DATA(nlh);
-
- /* copy the data to the payload */
- memcpy(msg,pEvData,msgSize);
-
- NETLINK_CB(skb).pid = 0; /* from kernel */
- NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
+ }
+
+ /* set the netlink header params */
+ nlh = NLMSG_PUT(skb, 0, 0, NLMSG_DONE, realSize - sizeof(*nlh));
+
+ /* get the payload pointer */
+ msg = (char *)NLMSG_DATA(nlh);
+
+ /* copy the data to the payload */
+ memcpy(msg,pEvData,msgSize);
+
+ NETLINK_CB(skb).pid = 0; /* from kernel */
+ NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
- NETLINK_CB(skb).dst_pid = (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID; /* Dm: */
+ NETLINK_CB(skb).dst_pid = (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID; /* Dm: */
#endif
- /* send the message*/
- res = netlink_unicast(drv->wl_sock, skb, (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID, MSG_DONTWAIT);
+ /* send the message*/
+ res = netlink_unicast(drv->wl_sock, skb, (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID, MSG_DONTWAIT);
- /* Sanity checks. As far as we're concerned this error is unrecovarable.*/
- if (res >= 0)
- {
+ /* Sanity checks. As far as we're concerned this error is unrecovarable.*/
+ if (res >= 0)
+ {
return 0;
- }
+ }
nlmsg_failure:
- ti_dprintf(TIWLAN_LOG_INFO,"IPC kernel: did not send the netlink message\n");
+ ti_dprintf(TIWLAN_LOG_INFO,"IPC kernel: did not send the netlink message\n");
return -1;
}