Lines Matching defs:psm

830 send_padr(poesm_t *psm, const poemsg_t *pado)
843 psm->poesm_sequence++;
846 (void) poe_two_longs(poep, POETT_UNIQ, psm->poesm_localid,
847 psm->poesm_sequence);
915 act_none(poesm_t *psm, poemsg_t *pmsg, int event, int nextst)
922 act_fail(poesm_t *psm, poemsg_t *pmsg, int event, int nextst)
931 act_spadi(poesm_t *psm, poemsg_t *pmsg, int event, int nextst)
933 if (send_padi(psm->poesm_localid) != 0)
939 if (psm->poesm_state == PCSMS_DEAD) {
940 psm->poesm_count = 3;
941 psm->poesm_interval = pado_wait_time;
943 if ((psm->poesm_interval <<= 1) > RESTART_LIMIT)
944 psm->poesm_interval = RESTART_LIMIT;
946 psm->poesm_timer = psm->poesm_interval;
953 act_add(poesm_t *psm, poemsg_t *pmsg, int event, int nextst)
957 if (psm->poesm_lastoff == NULL)
958 psm->poesm_firstoff = pmsg;
960 psm->poesm_lastoff->poemsg_next = pmsg;
961 psm->poesm_lastoff = pmsg;
968 act_spadr(poesm_t *psm, poemsg_t *pmsg, int event, int nextst)
974 if ((msgp = psm->poesm_firstoff) == NULL)
976 retv = send_padr(psm, msgp);
982 psm->poesm_firstoff = msgp->poemsg_next;
983 msgp->poemsg_next = psm->poesm_tried;
984 psm->poesm_tried = msgp;
986 if (psm->poesm_state != PCSMS_REQSENT) {
987 psm->poesm_count = 3;
988 psm->poesm_interval = pads_wait_time;
990 if ((psm->poesm_interval <<= 1) > RESTART_LIMIT)
991 psm->poesm_interval = RESTART_LIMIT;
993 psm->poesm_timer = psm->poesm_interval;
1000 act_spadrp(poesm_t *psm, poemsg_t *pmsg, int event, int nextst)
1004 retv = send_padr(psm, pmsg);
1013 pmsg->poemsg_next = psm->poesm_tried;
1014 psm->poesm_tried = pmsg;
1015 return (psm->poesm_state);
1017 pmsg->poemsg_next = psm->poesm_firstoff;
1018 psm->poesm_firstoff = pmsg;
1019 if (psm->poesm_lastoff == NULL)
1020 psm->poesm_lastoff = pmsg;
1021 psm->poesm_count = 3;
1022 psm->poesm_timer = psm->poesm_interval = pads_wait_time;
1029 act_spadrn(poesm_t *psm, poemsg_t *pmsg, int event, int nextst)
1034 if ((msgp = psm->poesm_firstoff) == NULL)
1037 psm->poesm_firstoff = msgp->poemsg_next;
1038 msgp->poemsg_next = psm->poesm_tried;
1039 psm->poesm_tried = msgp;
1040 if ((msgp = psm->poesm_firstoff) == NULL)
1042 retv = send_padr(psm, msgp);
1046 psm->poesm_count = 3;
1047 psm->poesm_timer = psm->poesm_interval = pads_wait_time;
1068 act_open(poesm_t *psm, poemsg_t *pmsg, int event, int nextst)
1086 ptp.ptp_lsessid = psm->poesm_localid;
1193 static int (* const action_table[PCSMA__MAX])(poesm_t *psm, poemsg_t *pmsg,
1204 handle_event(poesm_t *psm, int event, poemsg_t *pmsg)
1211 poe_state(psm->poesm_state), psm->poesm_state,
1212 poe_action(client_action[psm->poesm_state][event]),
1213 client_action[psm->poesm_state][event]);
1215 nextst = (*action_table[client_action[psm->poesm_state][event]])(psm,
1216 pmsg, event, client_next_state[psm->poesm_state][event]);
1220 poe_state(psm->poesm_state), psm->poesm_state,
1223 psm->poesm_state = nextst;
1400 poesm_t psm;
1412 (void) memset(&psm, '\0', sizeof (psm));
1420 psm.poesm_sequence = getpid() << 16;
1421 psm.poesm_localid = localid;
1424 handle_event(&psm, PCSME_OPEN, NULL);
1431 retv = poll(pfd, 1, psm.poesm_timer > 0 ? psm.poesm_timer :
1440 psm.poesm_timer = 0;
1441 handle_event(&psm, --psm.poesm_count > 0 ? PCSME_TOP :
1447 if (psm.poesm_timer > 0) {
1459 psm.poesm_timer -= tv.tv_sec*1000 + tv.tv_usec/1000;
1501 (psm.poesm_firstoff == NULL ||
1502 memcmp(&psm.poesm_firstoff->poemsg_sender,
1508 ehost(&psm.poesm_firstoff->poemsg_sender));
1516 if (seqval != psm.poesm_sequence) {
1527 psm.poesm_sequence);
1537 handle_event(&psm, PCSME_RPADT, &pmsg);
1547 handle_event(&psm, retv != 0 ? PCSME_RPADSN :
1558 handle_event(&psm, retv, &pmsg);