Skip to content

Commit

Permalink
Phonet: 'connect' socket implementation for Pipe controller
Browse files Browse the repository at this point in the history
Based on suggestion by Rémi Denis-Courmont to implement 'connect'
for Pipe controller logic,  this patch implements 'connect' socket
call for the Pipe controller logic.
The patch does following:-
- Removes setsockopts for PNPIPE_CREATE and PNPIPE_DESTROY
- Adds setsockopt for setting the Pipe handle value
- Implements connect socket call
- Updates the Pipe controller logic

User-space should now follow below sequence with Pipe controller:-
-socket
-bind
-setsockopt for PNPIPE_PIPE_HANDLE
-connect
-setsockopt for PNPIPE_ENCAP_IP
-setsockopt for PNPIPE_ENABLE

GPRS/3G data has been tested working fine with this.

Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kumar Sanghvi authored and davem330 committed Oct 13, 2010
1 parent 7368ddf commit b3d6255
Show file tree
Hide file tree
Showing 4 changed files with 215 additions and 191 deletions.
3 changes: 1 addition & 2 deletions include/linux/phonet.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@
/* Socket options for SOL_PNPIPE level */
#define PNPIPE_ENCAP 1
#define PNPIPE_IFINDEX 2
#define PNPIPE_CREATE 3
#define PNPIPE_PIPE_HANDLE 3
#define PNPIPE_ENABLE 4
/* unused slot */
#define PNPIPE_DESTROY 6

#define PNADDR_ANY 0
#define PNADDR_BROADCAST 0xFC
Expand Down
4 changes: 2 additions & 2 deletions include/net/phonet/pep.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ struct pep_sock {
u8 init_enable; /* auto-enable at creation */
u8 aligned;
#ifdef CONFIG_PHONET_PIPECTRLR
u16 remote_pep;
u8 pipe_state;
u8 pipe_state;
struct sockaddr_pn remote_pep;
#endif
};

Expand Down
Loading

0 comments on commit b3d6255

Please sign in to comment.