1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - MB - include
3   File:     mb_child.h
4 
5   Copyright 2007-2008 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2008-09-17#$
14   $Rev: 8556 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NITRO_MB_MB_CHILD_H_
19 #define NITRO_MB_MB_CHILD_H_
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #include <nitro/types.h>
26 #include <nitro/mb/mb.h>
27 
28 /* ---------------------------------------------------------------------
29 
30         Type Definitions
31 
32    ---------------------------------------------------------------------*/
33 
34 //---------------------------------------------------------
35 // Child's download state
36 //---------------------------------------------------------
37 
38 typedef enum
39 {
40     MB_COMM_CSTATE_NONE,               // State before initialization
41     MB_COMM_CSTATE_INIT_COMPLETE,      // State when MB child initialization has completed.
42     MB_COMM_CSTATE_CONNECT,            // State when connection to parent has completed.
43     MB_COMM_CSTATE_CONNECT_FAILED,     // State when connection to parent has failed.
44     MB_COMM_CSTATE_DISCONNECTED_BY_PARENT,      // State when disconnected by parent
45     MB_COMM_CSTATE_REQ_ENABLE,         // State when MP is established and data requests are possible.
46     MB_COMM_CSTATE_REQ_REFUSED,        // State when kicked from the parent in response to a request
47     MB_COMM_CSTATE_DLINFO_ACCEPTED,    // State when a request has been accepted by a parent
48     MB_COMM_CSTATE_RECV_PROCEED,       // State when download data receipt has commenced.
49     MB_COMM_CSTATE_RECV_COMPLETE,      // State when download data receipt has completed.
50     MB_COMM_CSTATE_BOOTREQ_ACCEPTED,   // State when a boot request from a parent has been received.
51     MB_COMM_CSTATE_BOOT_READY,         // State when communication with a parent is disconnected and boot is complete.
52     MB_COMM_CSTATE_CANCELED,           // State when canceled midway, and disconnect from parent is complete.
53     MB_COMM_CSTATE_CANCELLED = MB_COMM_CSTATE_CANCELED,
54     MB_COMM_CSTATE_AUTHENTICATION_FAILED,       //
55     MB_COMM_CSTATE_MEMBER_FULL,        // State when the number of entries to the parent has exceeded capacity.
56     MB_COMM_CSTATE_GAMEINFO_VALIDATED, // State when parent beacon is received.
57     MB_COMM_CSTATE_GAMEINFO_INVALIDATED,        // Case in which a parent beacon that has already been obtained is in an incomplete state.
58     MB_COMM_CSTATE_GAMEINFO_LOST,      // Notification of a state in which the parent's beacon has been lost.
59     MB_COMM_CSTATE_GAMEINFO_LIST_FULL, // Notification of state in which no more parents can be obtained.
60     MB_COMM_CSTATE_ERROR,              // State in which an error was generated midway through.
61 
62     MB_COMM_CSTATE_FAKE_END,           // Fake child completion notification (this state transitioned to only when using mb_fake_child)
63 
64     /* Internally used enumerator.
65        Cannot transition to this state. */
66     MB_COMM_CSTATE_WM_EVENT = 0x80000000
67 }
68 MBCommCState;
69 
70 #define MBCommCStateCallback    MBCommCStateCallbackFunc
71 /*  Child event notification callback type */
72 typedef void (*MBCommCStateCallbackFunc) (u32 status, void *arg);
73 
74 
75 /* ---------------------------------------------------------------------
76         Multiboot library (MB) API - For the child device
77    ---------------------------------------------------------------------*/
78 
79 /*---------------------------------------------------------------------------*
80   Name:         MB_SetRejectGgid
81 
82   Description:  Specifies GGIDs for which to reject transmissions.
83                 If you specify TRUE for 'enable', beacons will no longer be accepted from a parent device if an AND operation on its GGID and 'mask' produces the same result as an AND operation on 'ggid' and 'mask'.
84 
85 
86   Arguments:    ggid: The GGID to exclude
87                 mask: The GGID mask
88                 enable: To enable, TRUE; to disable, FALSE.
89 
90   Returns:      None.
91  *---------------------------------------------------------------------------*/
92 void    MB_SetRejectGgid(u32 ggid, u32 mask, BOOL enable);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 
99 #endif // NITRO_MB_MB_CHILD_H_
100