upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / misc / modem / pdp.h
1 /*
2  * Modem Network driver: PDP
3  *
4  * Copyright (C) 2010 Samsung Electronics Co.Ltd
5  * Author: Joonyoung Shim <jy0922.shim@samsung.com>
6  *
7  * This program is free software; you can redistribute  it and/or modify it
8  * under  the terms of  the GNU General  Public License as published by the
9  * Free Software Foundation;  either version 2 of the  License, or (at your
10  * option) any later version.
11  */
12
13 #define PDP_CH_MIN              1
14 #define PDP_CH_MAX              15
15 #define PDP_CH_NR               (PDP_CH_MAX - PDP_CH_MIN + 1)
16 #define PDP_CH_NET(ch)          (ch + CHID_PSD_DATA1 - PDP_CH_MIN)
17 #define NET_CH_PDP(ch)          (ch - CHID_PSD_DATA1 + PDP_CH_MIN)
18
19 struct pdp_parent {
20         struct net_device       *ndev;
21         int                     (*ndev_tx)(struct net_device *ndev,
22                                            struct sipc4_tx_data *tx_data);
23 };
24
25 struct pdp_device {
26         struct list_head        node;
27         struct pdp_parent       parent;
28         struct mutex            pdp_mutex;
29         struct net_device       *pdp_devs[PDP_CH_NR];
30         int pdp_cnt;
31         unsigned long           pdp_suspend_bitmap;
32 };
33
34 struct pdp_priv {
35         struct net_device       *ndev;
36         struct pdp_parent       *parent;
37         struct work_struct      tx_work;
38         struct sk_buff_head     tx_skb_queue;
39         int                     ch;
40 };
41
42 extern int pdp_register(struct net_device *ndev, struct pdp_device *pdp);
43 extern void pdp_unregister(struct net_device *ndev);