@@ -711,93 +711,6 @@ static int deliver_to_subscribers(struct snd_seq_client *client,
711711 return (result < 0 ) ? result : num_ev ;
712712}
713713
714-
715- #ifdef SUPPORT_BROADCAST
716- /*
717- * broadcast to all ports:
718- */
719- static int port_broadcast_event (struct snd_seq_client * client ,
720- struct snd_seq_event * event ,
721- int atomic , int hop )
722- {
723- int num_ev = 0 , err , result = 0 ;
724- struct snd_seq_client * dest_client ;
725- struct snd_seq_client_port * port ;
726-
727- dest_client = get_event_dest_client (event , SNDRV_SEQ_FILTER_BROADCAST );
728- if (dest_client == NULL )
729- return 0 ; /* no matching destination */
730-
731- read_lock (& dest_client -> ports_lock );
732- list_for_each_entry (port , & dest_client -> ports_list_head , list ) {
733- event -> dest .port = port -> addr .port ;
734- /* pass NULL as source client to avoid error bounce */
735- err = snd_seq_deliver_single_event (NULL , event ,
736- SNDRV_SEQ_FILTER_BROADCAST ,
737- atomic , hop );
738- if (err < 0 ) {
739- /* save first error that occurs and continue */
740- if (!result )
741- result = err ;
742- continue ;
743- }
744- num_ev ++ ;
745- }
746- read_unlock (& dest_client -> ports_lock );
747- snd_seq_client_unlock (dest_client );
748- event -> dest .port = SNDRV_SEQ_ADDRESS_BROADCAST ; /* restore */
749- return (result < 0 ) ? result : num_ev ;
750- }
751-
752- /*
753- * send the event to all clients:
754- * if destination port is also ADDRESS_BROADCAST, deliver to all ports.
755- */
756- static int broadcast_event (struct snd_seq_client * client ,
757- struct snd_seq_event * event , int atomic , int hop )
758- {
759- int err , result = 0 , num_ev = 0 ;
760- int dest ;
761- struct snd_seq_addr addr ;
762-
763- addr = event -> dest ; /* save */
764-
765- for (dest = 0 ; dest < SNDRV_SEQ_MAX_CLIENTS ; dest ++ ) {
766- /* don't send to itself */
767- if (dest == client -> number )
768- continue ;
769- event -> dest .client = dest ;
770- event -> dest .port = addr .port ;
771- if (addr .port == SNDRV_SEQ_ADDRESS_BROADCAST )
772- err = port_broadcast_event (client , event , atomic , hop );
773- else
774- /* pass NULL as source client to avoid error bounce */
775- err = snd_seq_deliver_single_event (NULL , event ,
776- SNDRV_SEQ_FILTER_BROADCAST ,
777- atomic , hop );
778- if (err < 0 ) {
779- /* save first error that occurs and continue */
780- if (!result )
781- result = err ;
782- continue ;
783- }
784- num_ev += err ;
785- }
786- event -> dest = addr ; /* restore */
787- return (result < 0 ) ? result : num_ev ;
788- }
789-
790-
791- /* multicast - not supported yet */
792- static int multicast_event (struct snd_seq_client * client , struct snd_seq_event * event ,
793- int atomic , int hop )
794- {
795- pr_debug ("ALSA: seq: multicast not supported yet.\n" );
796- return 0 ; /* ignored */
797- }
798- #endif /* SUPPORT_BROADCAST */
799-
800-
801714/* deliver an event to the destination port(s).
802715 * if the event is to subscribers or broadcast, the event is dispatched
803716 * to multiple targets.
@@ -826,15 +739,6 @@ static int snd_seq_deliver_event(struct snd_seq_client *client, struct snd_seq_e
826739 if (event -> queue == SNDRV_SEQ_ADDRESS_SUBSCRIBERS ||
827740 event -> dest .client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS )
828741 result = deliver_to_subscribers (client , event , atomic , hop );
829- #ifdef SUPPORT_BROADCAST
830- else if (event -> queue == SNDRV_SEQ_ADDRESS_BROADCAST ||
831- event -> dest .client == SNDRV_SEQ_ADDRESS_BROADCAST )
832- result = broadcast_event (client , event , atomic , hop );
833- else if (event -> dest .client >= SNDRV_SEQ_MAX_CLIENTS )
834- result = multicast_event (client , event , atomic , hop );
835- else if (event -> dest .port == SNDRV_SEQ_ADDRESS_BROADCAST )
836- result = port_broadcast_event (client , event , atomic , hop );
837- #endif
838742 else
839743 result = snd_seq_deliver_single_event (client , event , 0 , atomic , hop );
840744
@@ -936,14 +840,7 @@ static int snd_seq_client_enqueue_event(struct snd_seq_client *client,
936840 if (event -> queue == SNDRV_SEQ_ADDRESS_SUBSCRIBERS ) {
937841 event -> dest .client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS ;
938842 event -> queue = SNDRV_SEQ_QUEUE_DIRECT ;
939- } else
940- #ifdef SUPPORT_BROADCAST
941- if (event -> queue == SNDRV_SEQ_ADDRESS_BROADCAST ) {
942- event -> dest .client = SNDRV_SEQ_ADDRESS_BROADCAST ;
943- event -> queue = SNDRV_SEQ_QUEUE_DIRECT ;
944- }
945- #endif
946- if (event -> dest .client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS ) {
843+ } else if (event -> dest .client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS ) {
947844 /* check presence of source port */
948845 struct snd_seq_client_port * src_port = snd_seq_port_use_ptr (client , event -> source .port );
949846 if (src_port == NULL )
0 commit comments